Sharedaddy is an excellent social sharing plugin included within the plugin modules of Jetpack.
To use the entire Jetpack plugin, you’ll need to connect to a WordPress.com account.
If you don’t want to connect to WordPress.com, you can install the Slim Jetpack plugin as an alternative to the full version.
Once you’ve chosen the buttons you want to display, they will be displayed at the bottom of your posts.
You can also add more sharing buttons to Sharedaddy which aren’t included by default.
To display them at the top of all your posts, simply add this code to your child theme’s functions.php file.
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
add_filter( 'the_content', 'add_sharing_buttons_before_content', 19 );
add_filter( 'the_excerpt', 'add_sharing_buttons_before_content', 19 );
function add_sharing_buttons_before_content( $content = '' ) {
return sharing_display() . $content;
}
They’ll then be displayed above and below all your posts and pages depending on the configuration of your settings.
It’s be proven time and time again that content above the fold gets far more attention from readers.
You would have to think that displaying your sharing buttons before your content will also improve the amount of shares you get as well.
Repositon Buttons Before or After Entry Title
This code provides another option i use at the moment here on WP Sites.
add_action( 'get_header', 'jptweak_remove_share' );
function jptweak_remove_share() {
remove_filter( 'the_content', 'sharing_display',19 );
remove_filter( 'the_excerpt', 'sharing_display',19 );
}
add_action( 'genesis_entry_header', 'reposition_jetpack', 15 );
function reposition_jetpack() {
if ( is_singular( 'post' ) && current_user_can( 'update_core' ) && function_exists( 'sharing_display' ) ) {
sharing_display( '', true );
}
}
This way the buttons only display for admins when logged in.
I’d like to display sharing buttons on the home page, but not on the archives pages or search results. Is there a way to customize the above code to that end? Thank you!
Add the conditional tag after the function for the front page.
This is the code I am using, and it is not displaying the share buttons on the front page: