Ok, it looks like the ideal way to do this with a conditional tag:
is_category( ” );
Something like this maybe?
//* Only show sharing buttons on category 53
function jptweak_remove_share() {
if ( is_category( '53' ) ) {
remove_filter( 'the_content', 'sharing_display',19 );
remove_filter( 'the_excerpt', 'sharing_display',19 );
if ( class_exists( 'Jetpack_Likes' ) ) {
remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
}
}
}
add_action( 'loop_start', 'jptweak_remove_share' );
I managed to do this by playing with the moving sharing icons code found here:
http://jetpack.me/2013/06/10/moving-sharing-icons/
However, what I really wanted to achieve is for the module script and css not to load on every post whether sharing was selected or not.
I found that by creating a custom post type I can select this post type as an option in the sharing settings which gives me the granular control I was looking for.
what I really wanted to achieve is for the module script and css not to load on every post whether sharing was selected or not.
Another option would be to check the box appearing at the bottom of the sharing settings screen to remove all sharing resources from your site, and then enqueue them back manually, only on the pages you want. You can read more about this here:
https://jetpack.me/2013/05/03/custom-sharing-libraries/