Advertise on Site! You can Advertise on our site. Find out More

Add Custom Content to End of RSS Post

RSS (most commonly expanded as Really Simple Syndication) is a family of web feed formats used to publish frequently updated works—such as blog entries, news headlines, audio, and video—in a standardized format.

custom meta tags
RSS feed are very important. WordPress has own wordpress api to designed many RSS feed format.
In this tutorial I will show you how to add the custom text in your rss feed.
You just need to open your functions.php file and put following code in that file.

function feed_the_Filter($query) {
if ($query->is_feed) {
add_filter('the_content','add_to_feed');
}
return $query;
}
add_filter('pre_get_posts','feed_the_Filter');

function add_to_feed($content) {
$content .= '<p>Follow us on Twitter &amp;lt;a href="http://twitter.com/wordpressapi"&amp;gt;Wordpress API&amp;lt;/a&amp;gt;</p>';
$content .= '<p>Join our &amp;lt;a href="http://www.facebook.com/pages/wordpressapi/280021545846"&amp;gt;Wordpress API Facebook Community Page&amp;lt;/a&amp;gt;</p>';

return $content;
}
  • http://randyleonardap.blogia.com Shan Grainger

    Well I really enjoyed studying it. This tip offered by you is very helpful for proper planning.

  • http://www.pacocostas.com/motor/foro/member/8041/ Jackeline Kidder

    Of course, what a splendid site and illuminating posts, I definitely will bookmark your website.Have an awsome day!

  • http://www.kuro5hin.org/user/russarazjx/info Jame Kanter

    Good post. I learn something more difficult on totally different blogs everyday. It should at all times be stimulating to learn content from different writers and observe slightly something from their store. I’d favor to use some with the content material on my weblog whether you don’t mind. Natually I’ll offer you a link on your web blog. Thanks for sharing.

  • http://www.jauhari.net/ Jauhari

    Why This code didn’t work?

    • http://wordpressapi.com Wordpress API

      If you are checking in excerpt rss then this code will not work. Just try to add the_excerpt function also.