Post Pic

Hack: insert ads in your RSS feed

Some time ago, I featured a recipe about inserting ads on your rss feed. Sadly, some users had problems and reported that the function don’t work (althought some users said it worked, strange). So here’s a new recipe to insert text or ads in your rss feed.

If you have problem while using the recipe here, try that one:
Simply paste the following code on the functions.php file from your theme. Create that file if it doesn't exists by default.

function insertRss($content) {
    if(is_feed()){
        $content = 'text before content'.$content.'<hr /><a href="http://www.wprecipes.com">Did you visited WpRecipes today?</a><hr />';
    }
    return $content;
}
add_filter('the_content', 'insertRss');

Another great way to insert ads or anything in to your rss feed is the Rss Footer plugin by Joost de Valk.

Thanks to Julien Chauvin for the great tip!

Leave a Comment

* Name, Email, Comment are Required