Add Social Media Icons To Genesis (Without a Plugin)

99% of social media plugins are crap. Many are poorly coded, and some only exist as a way to advertise inside the WordPress dashboard. If you’re not comfortable with code, then I would recommend trying Jetpack Sharing.

Otherwise, the code below is what I use (when I don’t use Jetpack).

The following will add the horizontal Facebook, Twitter, Google Plus, Pinterest, Pocket, StumbleUpon, LinkedIn, and Reddit icons above each post. Add the following code to functions.php:

Some basic styles:

Advanced

If you want to move the icons underneath a post, change the action hooks.

add_action( 'genesis_before_entry', 'child_social_media_icons', 5 );

to this:

add_action( 'genesis_after_entry', 'child_social_media_icons', 5 );

If you want the icons to appear on both posts AND pages, but not the homepage?

if ( is_single() ) { ?>

to this:

if ( !is_front_page() ) { ?>

To learn more about conditional tags, visit http://codex.wordpress.org/Conditional_Tags

Author: Greg Rickaby

Greg is Lead Front-End Developer at WebDevStudios and author of a children’s book titled, Creating a Website: Design and Build Your First Site!.

12 thoughts on “Add Social Media Icons To Genesis (Without a Plugin)”

  1. Is it necessary to change “genesis_before_post_content” to “genesis_before_entry_content” with HTML 5 layouts?

  2. I couldn’t get it to work at first, until I switched out the genesis_before_post_content hook with the new HTML5 hook, genesis_entry_content. Then, it was flawless. Thanks!

Leave a Reply