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

  1. gavsiu
    Posted 4 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.


  2. Ryan Cowles
    Posted 4 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
    Posted 4 years ago #

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

  4. gavsiu
    Posted 4 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
    Posted 4 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

    Plugin Contributor

    Posted 4 years ago #

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

  7. guidedself
    Posted 3 years 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!


  8. Jeremy Herve
    Jetpack Mechanic
    Plugin Author

    Posted 3 years 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

  • Jetpack by WordPress.com
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic