Reply 223370 to: Static Blocks in Promo Text

Avatar: stieranka
stieranka
Participant
October 17, 2019 at 11:43

Hi,
thanks.
Hm… good idea. I guess I looked at it badly … I wanted to modify the original element instead of using another.

In the meantime, I modified file
/wp-content/plugins/et-core-plugin/inc/customizer-bulder/templates/header/promo_text.php
line 73 change from

<span class = "text-nowrap"> <? php echo $ key ['text'] '; ?> </ Span>

to

<span class = "text-nowrap"> <? php echo do_shortcode ($ key ['text'] '); ?> </ Span>

After I create a custom shortcode (insert to function.php in child theme) for show et-icons:

// shortcode for show et-icon
// use: [ss_show_et_icon icon="delivery" typ="light"]
// icon: delivery, coupon, calendar, compare, checked, chat, phone, exclamation, gift, heart, message, internet, sent, shopping-bag
// typ: bold, light
add_shortcode( 'ss_show_et_icon', 'ss_show_et_icon_func' );
function ss_show_et_icon_func( $atts ) {
	global $et_icons;
	$param = shortcode_atts( array(
		'icon' => '',
		'typ' => '',
	), $atts );
	if ( $param['icon'] != '' ) {
		if ( $param['typ'] == 'bold' ) {
			$icons = $et_icons['bold'];
		} else {
			$icons = $et_icons['light'];
		}
		$output = '<span class="et_b-icon" style="top: 2px; margin-right: .3em;">'.$icons['et_icon-'.$param['icon']].'</span> ';
		return $output;
	}
}

But your solution is better :-), I write only if someone would use shortcode…

Steve

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.