Global Block on Blog Post Page

I tried using this, but nothing showed up on my main blog page:

I am using Pro Theme with custom headers. Not sure if that changes things. But I was able to use this:

for individual post pages, but can’t get the block to show up on the main blog page.

Hi,

To add a global block to your blog page. You can change your code to this.

function add_global_post() {   
    /* Single Post Page */
    if(is_singular('post')){
         echo do_shortcode('[yourshortcode]');
     }
    /* Blog Page  */
      if(is_home()){
         echo do_shortcode('[yourshortcode]');
     }
}
add_action( 'x_before_site_end', 'add_global_post', 10 );

Hope that helps.

Thank you. Works great now!

You’re welcome! :slight_smile:

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