0

I'm trying to add some custom elements to a site's RSS feed. I thought it would be as simple as adding something like this to the active theme's functions.php:

function add_fields_to_videocast_rss_item() { echo "<test>This is a test</test>"; } add_action('rss2_item', 'add_fields_to_videocast_rss_item'); 

However, when I call the feed URL at: http://my.site.com/feed this code never gets executed. In fact functions.php isn't used. This doesn't match with the official docs on this in de WP Codex.

Anything I'm missing here?

2 Answers 2

0

I think it's help for you. just try to implement this.

http://www.wpbeginner.com/wp-tutorials/how-to-create-custom-rss-feeds-in-wordpress/

2
  • Answers should not rely on external links. The link also does not appear to answer the question that was asked. Commented Jan 12, 2018 at 5:30
  • Thanks for the reply, but the problem is that code from functions.php isn't executed on the feed URL. Even when I write a small plugin it's not being executed on the feed URL, only on regular pages. Commented Jan 12, 2018 at 17:54
0

It turned out to be a fringe case that had more to do with the hosting platform than anything. The site was hosted at WPEngine and the caching system (Varnish) was throwing things off. Posting this just in case someone else ever walks into this.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.