If you are self hosting WordPress on your server then you are missing out tons of features available specifically to wordpress.com users. To narrow this gap down, WordPress team has developed Jetpack plugin for self hosted blogs so they can also take benefits of these features without hosting their website on wordpress.com’s restrictive environment. Since Jetpack solves tons of problems in one single plugin and packs with many great features to supercharge your website, it is one of the most popular plugin in WordPress plugin respiratory. Today we will discuss Share Buttons feature in Jetpack.
The Jetpack sharing buttons in the plugin are the easiest way to share content and connect with social networking websites. By default WordPress adds the Jetpack sharing buttons to the bottom of your post content. This could be an issue for some who want to display Jetpack sharing buttons above post content. But the problem is that the plugin does not provide any option or straight forward way to change the default location of sharing buttons. Following is a simple solution for you, if you want to move these Jetpack sharing buttons above post content and post title.
If you would like to display the Jetpack sharing buttons at the top and bottom of your entry content, just paste this code snippet into your theme’s functions.php file.
// add jetpack share buttons above post content
function wcs_move_jetpack_share_buttons_above_content( $content = '' ) {
if ( function_exists( 'sharing_display' ) ) {
return sharing_display() . $content;
} else {
return $content;
}
}
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
add_filter( 'the_content', 'wcs_move_jetpack_share_buttons_above_content', 19 );
add_filter( 'the_excerpt', 'wcs_move_jetpack_share_buttons_above_content', 19 );
Worked like a charm! Thank you
Marie, glad you found it helpful. Looking forward to hearing much more from you.
Where exactly to add?
You should paste this code snippet into your theme’s functions.php file.
It’s written there.
Nice tutorial, loved it! thanks! :)
Thanks Ataul,
I’m glad you found it useful :)
Thanks You :)
How to I have the sharing buttons only above the post?
Terrific! Is there a way to remove the share buttons from appearing at the bottom?
Make sure you don’t add anything else than the code to theme functions.php because it can make your site go blank when there is an error.
Thanks a lot for this. Very helpful, very easy. God bless.
Seyi, I am glad you found it helpful. :)