Last active
August 29, 2015 14:03
-
-
Save bookchiq/2f31e85811905be0a0c5 to your computer and use it in GitHub Desktop.
WordPress + Jetpack: manually show the social sharing display
This file contains 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 | |
// Remove the default buttons display | |
function nl_april_choulat_remove_default_share() { | |
remove_filter( 'the_content', 'sharing_display', 19 ); | |
remove_filter( 'the_excerpt', 'sharing_display', 19 ); | |
} | |
// Hooked on both actions to prevent showing it on both posts/pages AND other content that's filtered with 'the_content' | |
add_action( 'loop_start', 'nl_april_choulat_remove_default_share' ); | |
add_action( 'wp_head', 'nl_april_choulat_remove_default_share' ); |
This file contains 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 | |
// IMPORTANT: "Show buttons on" must be checked for the post type within "Settings" > "Sharing" | |
if ( function_exists( 'sharing_display' ) ) { | |
sharing_display( '', true ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment