Last active
February 8, 2017 09:26
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From http://www.wpsuperstars.net/wordpress-hooks/