WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Sharing Icons Show After Excerpt AND Content (5 posts)

  1. drokkon
    Member
    Posted 1 year ago #

    I use the "excerpt" field to add my personal thoughts to an article and then use the main content area for the article itself. On my post pages I call the excerpt in a widget (for my take on the article) and then obviously the content shows too. The sharing icons are showing up after both.

    I came across this bit of code, which made me think that you had compensated for both an excerpt and the content appearing on the same page:

    // Many themes run the_excerpt() conditionally on an attachment page, then run the_content().
    // We only want to output the sharing buttons once.  Let's stick with the_content().

    I'm guessing that mine is still not working because my excerpt is called in a widget. Is there a way I can just turn off sharing from the excerpt in ALL cases? Disabling the share buttons from showing up on homepage/archive/search results in the settings doesn't do the trick.

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

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Could you try to add the following code to your functions.php file, and let me know if that helps?

    function jptweak_remove_exshare() {
    	remove_filter( 'the_excerpt', 'sharing_display',19 );
    }
    add_action( 'loop_end', 'jptweak_remove_exshare' );
  3. drokkon
    Member
    Posted 1 year ago #

    Unfortunately that didn't seem to do the trick.

    http://lightfromtheright.com/2013/01/10/james-buchanan-nobel-prize-winner-economics-passes-93/

    ...but thanks so much for the response!!!

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Sorry about that.

    I am not sure I can find a way to completely disable the sharing options without having a look at your theme code. You can, however, hide the buttons by adding the following code to your theme's stylesheet, or to your custom CSS if you've enabled the Custom CSS module in Jetpack:

    .widget_execphp .sharedaddy {
        display:none;
    }
  5. drokkon
    Member
    Posted 1 year ago #

    It never occurred to me to simply block the display with CSS, but that worked, of course - thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.