Skip to content

Instantly share code, notes, and snippets.

@jeherve
Created June 24, 2013 17:33
Show Gist options
  • Save jeherve/5851910 to your computer and use it in GitHub Desktop.
Save jeherve/5851910 to your computer and use it in GitHub Desktop.
Customize the Post info in the Genesis Framework, to add the Jetpack sharing buttons
<?php
//* Do NOT include the opening php tag
/** Delete the default Jetpack sharing buttons */
function jeherve_remove_share() {
if ( function_exists( 'sharing_display' ) )
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
}
add_action( 'init', 'jeherve_remove_share' );
/** Customize the post info function to add the Jetpack buttons into it */
function jeherve_post_info_filter( $post_info ) {
if ( !function_exists( 'sharing_display' ) )
$sharebuttons = '';
$sharebuttons = sharing_display();
return $post_info . $sharebuttons;
}
add_filter( 'genesis_post_info', 'jeherve_post_info_filter', 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment