Button Creation Question

I’m not sure if this is possible, but here it goes… I am trying to create a button image that can be put in a specific spot of every blog post… I don’t know if there is a universal way to do this without having to go into every single blog post? The purpose for this button/image would be to help with reducing bounce rate on my website if that makes sense… I’m trying to see if theres a faster way that manually doing this as I currently have 70 blog posts on my website. Any help would be appreciated… Thanks

Hi Brian,

Good day, while that is outside the scope of support, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here.

First, please create your section (with the Button) as a Global Block, then copy the shortcode of that Global Block after, you needed that.

Then add this to your child theme’s functions.php file.

/**
Add SHORTCODE ON EVERY POSTS
*/
function globalposts_button() { 
 if ( is_singular('post') ) : ?>
  <div class="globalposts-btn mtl">
    <?php echo do_shortcode( 'PASTE YOUR GLOBAL BLOCK SHORTCODE HERE' ); ?>
  </div>
  <?php endif; 
}
add_action('x_before_the_content_end','globalposts_button', 10);

Replace the phrase PASTE YOUR GLOBAL BLOCK SHORTCODE HERE with your actual Global Block shortcode.

Hope it helps,
Cheers!

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