Created
May 23, 2015 17:01
-
-
Save joedolson/9cd4f936b3833c9b0004 to your computer and use it in GitHub Desktop.
It hardly matters what else we do if this doesn't show up on the page! Use the power of filters and 'the_content' to get crucial data.
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
/* | |
* Use WordPress filter 'the_content' to add sharing links into post content. | |
* | |
* @param $content The current content of the post. | |
* | |
* @return $content The previous content of the post plus social sharing links. | |
*/ | |
add_filter( 'the_content', 'id24_post_content' ); | |
function id24_post_content( $content ) { | |
global $post; | |
$post_ID = $post->ID; | |
if ( is_main_query() && in_the_loop() ) { | |
$id24_social = id24_social_block( $post_ID ); | |
$content = $content . $id24_social; | |
} | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment