How can I generate a RSS feed based on a custom WP_Query?

You should use add_feed() function (take name of feed and callback) to add new feed, it will take care of settings up hooks and rewrite rules automagically.

Then in your callback function you can use query_posts() to override query before loading template.

Leave a Comment