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:

  1. How To Randomize Post Order In WordPress
  2. WordPress Theme Tweaking Cheat Seets
Tags: , , ,

Leave your response!

You can subscribe to these comments via RSS.