Skip to content

Instantly share code, notes, and snippets.

@ajmorris
Created May 15, 2013 20:33
Show Gist options
  • Save ajmorris/5587141 to your computer and use it in GitHub Desktop.
Save ajmorris/5587141 to your computer and use it in GitHub Desktop.
Adding to end of the_content
function add_footer_info($content) {
if( is_single() && is_main_query() ) {
$content .= get_template_part('includes/blog', 'author');
}
return $content;
}
add_filter('the_content', 'add_footer_info', 20);
@ajmorris
Copy link
Author

Basically I only want this to display the template part on single blog posts, no where else. So I added is_main_query() to not include CPTs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment