Skip to content

Instantly share code, notes, and snippets.

@clivewalker
Last active February 8, 2017 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clivewalker/33493fd5472971d9d9b5d87fe1fa98d3 to your computer and use it in GitHub Desktop.
Save clivewalker/33493fd5472971d9d9b5d87fe1fa98d3 to your computer and use it in GitHub Desktop.
Adding after post content with WP filter hook so that it's in RSS feed
function after_post_content($content) {
if(!is_feed() && !is_home()) {
$content.= '<h4>Like this post?</h4>';
$content.= '<p><a href="http://example.com/subscribe">Subscribe to our newsletter</a>!</p>';
}
return $content;
}
add_filter ('the_content', 'after_post_content');
@clivewalker
Copy link
Author

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