Code To Insert Ads In RSS Feed Of WordPress Blog?

Posted by

Hi,

In order to add the Ads in RSS feed of the blog, you need to add this code in functions.php file of the theme:

function insertRss($content) {
if(is_feed()){
$content = ‘text before content’.$content.'<hr /><a href=”http://www.bestwpthemez.com”>Best Free WordPress Theme Templates</a><hr />’;
}
return $content;
}
add_filter(‘the_content’, ‘insertRss’);

That’s it!

Thanks,

Shane G.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.