How to: List WordPress category feeds

Some time ago, I shown you how you can display a rss feed per category in your WordPress blog. Today, let’s see how we can list all category feeds by using the good old wp_list_categories() fiunction.

To achieve this recipe, simply paste the following code anywhere on your theme. It will output a list of your categories with a link to the category rss feed.

<?php wp_list_categories('feed_image=http://www.myblog.com/image.gif&feed=XML Feed&optioncount=1&children=0'); ?>

The two parameters used here are:

  • feed_image: The url of the image to display as a link to your feed.
  • feed: The feed format

3 Responses

Nov 24 2008 08:39

Hmm… Is “XML feed” valid argument? Can’t test it at work. Space is not encoded and I’ve seen mostly “rss”, “rss2″, “rdf” and “atom” used in WordPress as feed type. I mean all feeds are XML. :)

Nov 24 2008 08:59

@Rarst: I have tested it and it works perfectly. But I agree that the “XML Feed” arguments sounds a bit weird!

Nov 25 2008 21:10

Weird that you post this, i was looking all over for this tonight to use on my subscribe page :)

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required