How To Add Custom Content After Each Post In WordPress
Posted by admin
23 August 2010
If you want to add some custom content at the end of every post (for example, the author info) then copy the following code and paste it in the “functions.php” file of your theme.
[php]
function add_post_content($content)
{
if(!is_feed() && !is_home())
{
$content .= ‘<p>This article is written by ‘.the_author();
}
return $content;
}
add_filter(‘the_content’, ‘add_post_content’);
[/php]
Now the custom content from the “add_post_content” function will be inserted below each of your posts.
Related posts:
Tags: Add custom content, Cheat Sheet, Wordpress, WordPress Hacks









Leave your response!