How to: Provide a rss feed per category to your readers

Do you blog about a lot of different topics? If yes, you may want to provide a rss feed per category, so your readers will be able to only read what interests them. Believe it or not, this is very easy to achieve.

This recipe is probably one of the easiest to achieve I have ever published, but it is very useful. Let's say you'd like to be able to only suscribe to Cats Who Code blogging tips. The category url is:

http://www.catswhocode.com/blog/category/blogging

To get a rss feed, you simply have to add /feed at the end of the url:

http://www.catswhocode.com/blog/category/blogging/feed

To create a category rss feed, simply paste the following code:

<a href="<?php echo get_the_category().'/feed'; ?>"><?php echo get_the_category().' rss feed'; ?></a>

9 Responses

Nov 22 2008 19:38

This also works with tags (/tag/feed) and authors (/author/[name]/feed if I remember right).

btw some bloggers dislike such bleeding of subscriber count and use FeedSmith plugin that redirects all such extra feeds to main one.

Nov 22 2008 20:30

I didn’t know it works with tags and authors! Thanks for letting me know!

Nov 23 2008 12:21

Thanks a lot, very useful for my visitors, ty !

Nov 23 2008 14:02

Do remember that this won’t work when you’ve got the feedburner plugin enabled.

Nov 23 2008 14:07

@Joost: Thanks for letting us know about it! Btw, if you experience problems, you shold definitely use this htaccess trick to redirect your feeds to feedburner!

Nov 25 2009 23:03

Old post but…

Still very useful !

It is exactly what i was searching for.

Thanks,

SBG

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required