Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1066758
    jfhdc
    Participant

    Hello,

    I’m trying to figure out how to have the custom social sharing icons appear at the bottom of all our blog posts. I’ve figured out how to use the short code, but ideally my authors wouldn’t have to manually enter this every time they post.

    Is there a way to turn this on without creating a child theme? I feel like this must be a simple option somewhere that I’m just missing, but haven’t had any luck finding it.

    Thank you!

    #1066940
    Rahul
    Moderator

    Hi There,

    Thanks for writing in.

    You can add this code at your child theme’s functions.php to apply sharing for each single post page.

    add_filter('the_content', 'x_add_social_sharing', 9999);
    
    function x_add_social_sharing ( $content ) {
    
    return is_singular('post') ? $content.do_shortcode('[share title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]') : $content;
    
    }
    

    Hope this helps.

    #1066942
    Prasant Rai
    Moderator

    Hello There,

    Thanks for writing in1

    Implementing social sharing in blog posts will requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.

    After that kindly add the code below in your functions.php.

    add_action('x_before_the_content_end', function() {
      echo do_shortcode('[share title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]');
    });

    Hope that helps and kindly Let us know how this goes!

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1066758 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>