Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

thewatcheruatu on "adding action hook to rss feed"

$
0
0

I'm confused about something and I'm wondering if somebody can give me some insight. If I'm not mistaken, WordPress uses feed-rss2.php in the wp-includes folder to generate the RSS 2.0 feed. So I checked out that file and found this:

<?php
	/**
	 * Fires at the end of each RSS2 feed item.
	 *
	 * @since 2.0.0
	 */
	do_action( 'rss2_item' );
	?>

So my understanding is that in my theme's functions.php, I should be able to hook a function onto that like so:

function myrss_function() {
	echo '<mynodename>stuff</mynodename>';
}

add_action ('rss2_item', 'myrss_function');

I've done that, however nothing at all changes at http://mysite.com/feed/

So what I did was actually directly edit feed-rss2.php and hard code a dummy node in there, and still nothing changes when I view my site's feed. So I don't get it--is WP actually using something else to generate that feed output? I tried clearing my cache and using different browsers thinking it might have just been a caching issue, but it is the same result every time.


Viewing all articles
Browse latest Browse all 8245

Trending Articles