Adding global block / section below blog main page

Hi Team!

I’m wondering what you suggest is the best way to add a section that includes a global block below the main blog page content and above the footer / footer widget area.

My thoughts are either adding something to my functions file that hooks into the content end, or to add it to the footer and hide for all pages except the main blog?

I think the first method is more ideal if possible.

Thank you in advance

Hi there,

Thanks for writing in! You can add the following code in your Child Theme’s functions.php file:

function bottom_content() {
	if ( is_home() ) {
		echo do_shortcode('[cs_gb id=351]');
	}
}
add_action( 'x_after_view_global__index', 'bottom_content' );

Just replace the global block shortcode in the above code with yours. To learn more about conditional tags please see https://codex.wordpress.org/Conditional_Tags and for the hooks and filters in X / Pro you can refer to https://theme.co/apex/forum/t/customizations-actions-and-filters-in-x-pro/208

Cheers!

Brilliant! Thank you very much! I will try it out. Great to know as I can replicate this for other sections with conditional tags as well :slight_smile: Much thanks!

You are welcome :slight_smile:

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