Inserting Thing to Your RSS Feed

You can use the following snippet to insert a link back to your site, some advertising, social media options etc. Basically anything you like, add the following to your theme’s functions.php file :

<?php
function insertAds($content) {
$content = $content.'<hr /><a href="http://www.infoaceh.com">Have you visited InfoAceh today?</a><hr />';
return $content;
}
add_filter('the_excerpt_rss', 'insertAds');
add_filter('the_content_rss', 'insertAds');
?>

In this example, the custom html inserted is “<hr /><a href=”http://www.infoaceh.com”>Have you visited InfoAceh today?</a><hr />”

Simply change that to anything you like.

//wplift.com/wordpress-rss-feed-hacks

You may also like...