Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1315460
    Alexandre
    Participant

    Hi,

    in accordance with a post i found about this topic i added the following to my 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”]’);
    });

    I want the sharing function to be ONLY for posts however and not on the pages. How do i fix that issue?

    Best regards,
    Alex

    #1315462
    Alexandre
    Participant
    This reply has been marked as private.
    #1315468
    Thai
    Moderator

    Hi There,

    Please update your code to this:

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

    Hope it helps 🙂

    #1315736
    Alexandre
    Participant

    As usual you solve the problem on the first try! Thanks a bunch!

    #1315785
    Thai
    Moderator

    You’re most welcome 🙂

    #1315792
    Rahul
    Moderator

    You’re most welcome!

    Feel free to ask us again.

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