WordPress.org

Forums

[Plugin: Sharedaddy] How can I change the location of the share buttons (5 posts)

  1. MrSands
    Member
    Posted 4 years ago #

    Is there a way to change the location the share buttons appear in your post. I want them to appear in the post footer and not under the body.

    Thanks for any suggestions.

  2. mbzo2006
    Member
    Posted 3 years ago #

    I would also like to know.

  3. mbzo2006
    Member
    Posted 3 years ago #

    Custom placement of share buttons: still would like to know how to do this with sharedaddy.

  4. uberbrunch
    Member
    Posted 3 years ago #

    I would like to know as well. I'm using the Advanced Custom Fields plugin and Sharedaddy sticks the buttons in the custom fields instead of below the post. Had to deactivate it.

  5. ssokolow
    Member
    Posted 3 years ago #

    Just a note for anyone else who comes across this thread on Google.

    You can place the share buttons manually by inserting <?php echo sharing_display(); ?> into your template, but it'll only work once.

    That means that it'll automatically prevent the default buttons from showing if you put it above where they'd appear, but if you put it below where they'd appear, it'll have no effect.

    To place it below, you have to explicitly kill off the automatically-inserted buttons with these lines:

    remove_filter( 'the_content', 'sharing_display',19);
    remove_filter( 'the_excerpt', 'sharing_display',19);

    Apparently, putting them in your functions.php can work but, when I tried that with a child theme, it had no effect because they got called before the add_filter lines they were supposed to undo.

    I solved that by putting them at the top of my loop-single.php instead, just under the header comment.

    (Note: That file won't exist on all themes. See Template Hierarchy to figure out where to start tracking down the appropriate spot in themes other than Twenty Ten.)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags