Created
June 13, 2016 14:15
-
-
Save bob-moore/c96bd2c0253642226babc70b3058758a to your computer and use it in GitHub Desktop.
Jetpack Sharing Display Tweaks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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