WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] "Share this" displayed twice in attachment page with ca (8 posts)

  1. gavsiu
    Member
    Posted 2 years ago #

    If the attachment has captions, the attachments page will display "Share this" for the_excerpt(); and the_content();.

    Duplicate sharing buttons is unwanted especially since they're right above each other.

    http://wordpress.org/extend/plugins/jetpack/

  2. Ryan Cowles
    Member
    Plugin Author

    Posted 2 years ago #

    Also ran into the same problem. I found a post showing how to remove the filters, and then display the sharing buttons manually in your theme. Essentially, in your loop (probably in attachment.php) you remove the filters with:

    <?php remove_filter( 'the_content', 'sharing_display', 19 ); ?>
    <?php remove_filter( 'the_excerpt', 'sharing_display', 19 ); ?>
    <?php the_content(); ?>

    and manually add the sharing buttons to your theme with:

    <?php echo sharing_display(); ?>

  3. Ryan Cowles
    Member
    Plugin Author

    Posted 2 years ago #

    Just to clarify -- I included <?php the_content(); ?> just to show where the filters should go.

  4. gavsiu
    Member
    Posted 2 years ago #

    Shouldn't the remove_filters go in the functions.php?

    Also, the code needs to be checked after every plugin update. So I'll just wait and hope WordPress will fix the problem. At the moment, I just hid the extra "Share this" with css display: none.

  5. Ryan Cowles
    Member
    Plugin Author

    Posted 2 years ago #

    I believe you are correct... However, that will remove the buttons from the rest of your template pages as well. You can then just add in the <?php echo sharing_display(); ?> on your other template files as well, but by removing the filters on attachment.php directly, you will only be removing them from that the attachment pages.

  6. Tim Moore
    Moderator
    Plugin Author

    Posted 2 years ago #

    We are aware of this bug and will be fixing it in a future release. Thanks for the report!

  7. guidedself
    Member
    Posted 1 year ago #

    okay - I am having this issue as well - any plugin for sharing that I try shows up twice once in the page and once in the footer - what can I do and please be very very thorough - like you're talking to a sugar addled infant - I have no coding or customizing experience.

    HELP ME!

    http://www.the-hot-flash.com

  8. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    @guidedself We fixed this issue 6 months ago, so your problem might have another source.

    However, you do not seem to be using Jetpack Sharing at the moment. Since the problem happens with multiple plugins, you might want to check your theme files for duplicate loops.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic