Social share buttons on all blog post

Dear Sir/Madam,

Thank you for your helpful solutions. Please how do I introduce the social share button in all my post at the beginning and at the end of my blog articles? Please see the middle of this article (here).

Thank you,

Nsikanabasi

Hi Ijeoma,

Thanks for reaching us.

You can add the share option by editing each post using the Cornerstone and add the Share element into the beginning and end of the post.
On the other hand, you can add a Global Block with the Share elements and use the global block as a shortcode into the post.
Please check how Global Blocks can be used here: https://theme.co/docs/global-blocks#how-to-create-a-global-block
Specially how it can be used as shortcode: https://theme.co/docs/global-blocks#how-to-use-a-global-block
You can also use our theme hooks to add the shortcode through the code at functions.php of your child theme

function __x__addshortcode_to_post_begin()
{
  if(is_single())
  {
    echo do_shortcode('[cs_gb id=1976]'); //change the global shortcode to your one
  }    
}
add_action('x_before_the_content_begin','__x__addshortcode_to_post_begin');
add_action('x_after_the_content_end','__x__addshortcode_to_post_begin');

To know more on our theme hooks, please go through this article: https://theme.co/docs/actions-filters-and-hooks#x-and-pro-specific-actions-and-filters

Remember that the suggestion in the above-mentioned thread will work if copied as it is and doesn’t conflict with any existing code.
Please note that the code provided serves only as a guide to help you get started custom coding on your own if there’s no option offered in our theme or the products we bundle.
We do not provide support for custom codes and the modified child theme, that means we can’t fix it in case it conflicts with something in your site nor will we enhance it.

Thanks

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