• Resolved doctorproctor

    (@doctorproctor)


    Greetings — We have disabled “Show sharing buttons on” for a certain custom post type in Jetpack > Sharing Settings, but they still appear as this custom post type includes excerpts of regular posts (for which sharing is enabled). It’s annoying, as the sharing buttons appear under each post excerpt!

    Is there a shortcode or other solution I could add to the template for this custom post type to disable sharing buttons?

    Thanks,

    Jim P.

    https://www.ads-software.com/extend/plugins/jetpack/

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have a related problem or the same one:

    I have the Sharing button enabled just for single posts pages, but on my theme (Futurosity Magazine) there are some excerpts on the top of every single post. Under EVERY EXCERPT of them appears a button too. Is there any way to fix this?? On other pages, where I disabled the Sharing button, the excerpts show up properly.

    My web is https://www.quincunx.es

    Thanks.

    Plugin Contributor Tim Moore

    (@tmoorewp)

    You could try adding the following to your functions.php in your theme:

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

    Be aware that this will remove sharing buttons from ALL excerpts on your site.

    Thread Starter doctorproctor

    (@doctorproctor)

    Thanks; somehow it didn’t work. Btw, in my case excerpts (in e.g. the default blogroll page) are not showing the share buttons. Any additional ideas?

    Jim

    Hi, I’m currently finding the exact same issue. Tim, can you explain your code further?

    Adding this into functions.php like this doesn’t do anything for me.

    Also, what does the ’19’ signify?

    Thanks, Alistair

    Plugin Contributor Tim Moore

    (@tmoorewp)

    Try this in an mu-plugin file or in your theme’s functions.php:

    add_action( 'init', 'my_remove_filters_func' );
    
    function my_remove_filters_func {
         remove_filter( 'the_excerpt', 'sharing_display', 19 );
    }

    @ayepod: the 19 signifies the priority the original filter was added at. When removing the filter, you need to specify the same priority or the removal won’t work.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Jetpack by WordPress.com] Disable sharing in custom post template?’ is closed to new replies.