Skip to content

Instantly share code, notes, and snippets.

@bob-moore
Created June 13, 2016 14:15
Show Gist options
  • Save bob-moore/c96bd2c0253642226babc70b3058758a to your computer and use it in GitHub Desktop.
Save bob-moore/c96bd2c0253642226babc70b3058758a to your computer and use it in GitHub Desktop.
Jetpack Sharing Display Tweaks
<?php
/**
* Filter to stop jetpack from automatically inserting like buttons, so we can
* manually control their output
*/
if( !function_exists( 'jptweak_remove_share' ) ) {
function jptweak_remove_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', 'jptweak_remove_share' );
}
/**
* Function to manually output jetpack like buttons
*/
if( function_exists( 'sharing_display' ) ) {
echo sharing_display();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment