[wp-hackers] Adding a new rss feed to WordPress, how?

Austin Matzko if.website at gmail.com
Sat May 3 02:12:58 GMT 2008

On Fri, May 2, 2008 at 9:37 PM, Michael Dale <email at dalegroup.net> wrote:
>  What is the best way to add an RSS feed to  WordPress? I currently have a function that outputs the RSS but I'd  like to be able to hook into wordpress so that I don't need to add  another external file.

I would set the query variable "feed" to something particular to your
plugin, e.g. set_query_var('feed, 'whatever'), whenever you want to
output your custom feed.  Add a callback function to an action hook
that is named 'do_feed_' + your feed variable value, like so:

function load_feed_whatever() {
        load_template( ABSPATH . WPINC . '/feed-rss2.php' );
add_action('do_feed_whatever', 'load_feed_whatever');

That will use wp-includes/feed-rss2.php as your template.

More information about the wp-hackers mailing list