Dukeo » WordPress » Custom Post Footer: How to Insert It After Each Post On Your Blog

Custom Post Footer: How to Insert It After Each Post On Your Blog

Steven WordPress

There are many reasons why you might want to insert some custom content right after each post. However, you might now want to manually insert in it the right place and edit several files to do so.

An easy way to insert custom content after each post of your WordPress blog is to simply paste the following code in the functions.php file of your WordPress theme:

function add_post_content_footer($content) {
  if(!is_feed() && !is_home()) {
    $content .= 'INSERT CUSTOM CONTENT HERE';
  }
  return $content;
}
add_filter('the_content', 'add_post_content_footer');

If you enjoyed this article,
Get email updates

Join for Free »