Skip to content

Instantly share code, notes, and snippets.

@bookchiq
Last active August 29, 2015 14:03
Show Gist options
  • Save bookchiq/2f31e85811905be0a0c5 to your computer and use it in GitHub Desktop.
Save bookchiq/2f31e85811905be0a0c5 to your computer and use it in GitHub Desktop.
WordPress + Jetpack: manually show the social sharing display
<?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' );
<?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