I need to add some code to my RSS feeds, so I am searching for the RSS Feed .php file so I can add my code. Any help in finding this template file would be greatly appreciated.

3 Answers
3

To add some tags to the rss2 feed you may use the 3 action hooks that can be found in the wp-includes/feed-rss2.php

rss2_ns : to add a specific namespace

rss2_head : to add tags in the feed header

rss2_item : to add tags in each feed items

For example, let’s assume you want to add a copyright in your feed’s header using the dublin core vocabulary :

function my_rss2_head(){
    echo '<dc:rights>&copy; '.bloginfo_rss('name').'</dc:rights>'.PHP_EOL;
}
add_action( 'rss2_head', 'my_rss2_head');

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *