Created
June 24, 2013 17:33
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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