Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

clivewalker commented Feb 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.