Add Unique “Per Category” RSS Feeds – WordPress
A client came to me the other day with a neat request. He wanted the ability to offer unique RSS feeds for each of his WordPress blog’s categories. His site uses a custom permalink strategy, but I wanted to develop a solution that would work for all WordPress configurations.
The following code will display a unique RSS feed on each “category archive” page within your WordPress blog or site. The feed will contain only the posts within that category. If you have any questions about the code, or if you just like it a lot, leave a comment to let me know.
<?php /* If this is a category archive */ if (is_category()) { ?>
<span>
Subscribe to posts in <a href="/wp-rss2.php?cat=<?php echo get_query_var('cat'); ?>"><?php single_cat_title(); ?></a> via RSS
</span>
<?php } ?>
