Skip to content

Instantly share code, notes, and snippets.

@georgestephanis
Last active December 17, 2015 20:59
Show Gist options
  • Save georgestephanis/5671926 to your computer and use it in GitHub Desktop.
Save georgestephanis/5671926 to your computer and use it in GitHub Desktop.
When hooked to either the_content or the_excerpt filters, this should append the contents of the `author-box.php` file in your theme before the Jetpack ShareDaddy contents is added!
<?php
/**
* When hooked to either the_content or the_excerpt filters,
* this should append the contents of the `author-box.php`
* file in your theme before the Jetpack ShareDaddy contents
* is added, so long as the priority is 18 or less!
* (as ShareDaddy's sharing options go in at priority 19)
*
* @param string $content The post content as passed to the function
* @returns string The content with the author box appended to it.
*/
function my_author_box( $content = '' ) {
ob_start();
get_template_part( 'author', 'box' );
$author_box = ob_get_clean();
return $content . $author_box;
}
add_filter( 'the_content', 'my_author_box', 18 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment