Sharedaddy (jetpack) share button modifications

Community Forums Forums Design Tips and Tricks Sharedaddy (jetpack) share button modifications

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  jgk 2 years, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #48442



    I’m using Jetpack’s “share daddy” sharing buttons and I’m trying to make some modifications.

    I’m trying to get the sharedaddy buttons to appear on the top & bottom of the post on the individual blog post pages, but I only want the sharedaddy buttons to appear on the bottom of the post (after the excerpt) on the blog page.

    In an attempt to do this I’ve added the following code to my functions.php page in the child theme:

    //* Add Jetpack share buttons above post
    remove_filter( 'the_content', 'sharing_display', 19 );
    remove_filter( 'the_excerpt', 'sharing_display', 19 );

    add_filter( 'the_content', 'share_buttons_above_post', 19 );
    add_filter( 'the_excerpt', 'share_buttons_above_post', 19 );

    function share_buttons_above_post( $content = '' ) {
    if ( function_exists( 'sharing_display' ) ) {
    return sharing_display() . $content;
    else {
    return $content;

    But the sharedaddy buttons are still appearing on the top & bottom of the blog page before and after the excerpt.

    Any ideas on removing the sharedaddy above the posts on the blog page but leaving them above the post on single post pages?


    Please clarify your question.



    I have & shows small excerpts and several posts.

    I’d prefer to only show the sharedaddy sharing buttons below the post excerpt only. Right now its showing above the excerpt and below the excerpt.

    but on
    I’d like the sharedaddy sharing buttons to still be at the top of the post (as they are) and below the post (as they are). No change necessary.

    Thanks so much brad. I couldn’t find any instructions for this.

    as you can see here:

    having sharing buttons before and after the rather short excerpts is excessive & a bit spammy.



    Here’s the code you can add in your child themes functions.php file

    The hook position can be changed and you can also add a conditional tag.


     if ( function_exists( ‘sharing_display’ )  && is_archive() ) {

    You will need to modify this code to suit your needs.



    Thanks again Brad! That worked.

    Cheers, Jay

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.