Global Block in Header

Hello!

I’m trying to add a global block in header, but it’s not translating to the content; it just stays as a shortcode.

This is the code I’m using.

jQuery(document).ready(function($){
	$('<div class="icons">[cs_gb name="social-media-icons"]</div>').insertAfter('a.x-brand');
});

And I’ve also added this code in functions.php to allow shortcodes in header.

add_filter(‘x_option_x_topbar_content’, ‘top_bar_content_shortcode’);

function top_bar_content_shortcode ( $content ) {
return do_shortcode ( $content );
}

Hi Malav,

Thank you for writing in, the first block of code is not going to work.

The second block of code is for the Topbar Content to accept a shortcode. That means you can now place your shortcode [cs_gb name="social-media-icons"] in Theme Options > Headers > Topbar Content.

Hope it helps,
Cheers!

Oh I see. Is there anyway I can add global block in header then?

Hello Malav,

Regretfully there is no option at the momment. It would require custom development. I would suggest you contact a developer who can assist you with your concern or you can avail of our service called One where customization questions are answered. Please note we don’t provide custom development support. It is out of the support scope.

Alternatively, you can upgrade your theme to a Pro theme where you would get a Header builder, you can custom design your header without coding.

Thanks for understanding

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.