Can a global block be inserted at the footer of a blog page and all blog single pages?

Hi, I’m doing a blog as a news page on a site and I’ve created my own footer with a global block which I want to use on all of the pages, but I don’t know how to code it so the footer global block also appears on the footer of the blog page and the single blog pages! I hope it’s possible to do!

I’ll put the URL in a secure note as it’s being built on a temporary link.

Thanks!

Hi @core365,

I could see you’ve already setup a child theme. Please add the following code under functions.php file locates in your child theme:

add_action( 'x_before_view_footer_base', 'x_print_gb' );
function x_print_gb(){
	if(is_singular( 'post' ) || is_home()){
		echo do_shortcode( '[your-global-block]'  );
	}
}

Hope it helps :slight_smile:

Hi, that’s fab, thank you!

Thanks ever so much, I really appreciate your time and help!

You’re welcome!
We’re glad @Thai were able to help you out.

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