The Jetpack plugin for WordPress has many very useful features. One of those is social sharing where a visitor to your page or post may share to Twitter, Facebook, Reddit, Pinterest and so on.
Selecting whether to show the social media sharing icons on media, pages or posts is simple. By default the sharing buttons show below the page or post content however adding the icons in a second location isn’t a matter of selecting a checkbox. Follow the instructions below to show the Jetpack social media icons above the logo in Genesis (StudioPress) Themes.
- Install and activate the Genesis Simple Hooks plugin.
- In your WordPress dashboard go to Genesis then Simple Hooks.
- In the Header Hooks section, enter the following in the genesis_before_header field:
<? if ( function_exists( 'sharing_display' ) ) { sharing_display( '', true ); } if ( class_exists( 'Jetpack_Likes' ) ) { $custom_likes = new Jetpack_Likes; echo $custom_likes->post_likes( '' ); } ?>
- Click to add a check in the Execute PHP on this hook? field.
- Click Save Changes
The sharing buttons will now be replicated in the header.
If you then want to style your sharing area per the attached image then add the following CSS using the Jetpack Custom CSS Editor:
.sd-content { background-color: #c3251d; padding-top: 0.9em; padding-bottom: 0.9em; } div.sharedaddy.sd-sharing-enabled > div > h3 { font-size: 200%; } .sd-sharing-enabled { text-align: center; background-color: #ffffe0; } div.sharedaddy h3.sd-title:before { border-top-width: 0; }
Leave a ReplyCancel reply