Skip to content

Instantly share code, notes, and snippets.

@devinsays
Created August 2, 2015 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devinsays/17e3df2a978ab6c66085 to your computer and use it in GitHub Desktop.
Save devinsays/17e3df2a978ab6c66085 to your computer and use it in GitHub Desktop.
Example of how to remove the JetPack share buttons so that you can output them in a different part of the template.
/**
* Removes automatic display of JetPack share buttons
*/
function branch_remove_jetpack_share() {
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', 'branch_remove_jetpack_share' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment