WordPress Guy

WordPress Guy designs and develops WordPress themes and plugins. WordPress Guy teaches you WordPress stuff.

Did you know that WordPress comes with the ability to publish category feeds? That’s right, you can give that option to your readers by providing them with the category feed. Or, you can subscribe to a blog where you’re only interested in one of the categories.

If you’re using “pretty” permalinks:

http://yourblog.com/category/categoryname/feed

Or if you’re using query string permalinks (the un-pretty ones):

http://yourblog.com/wp-rss2.php?cat=14

Where 14 is the ID of the category.

You can add this to your archive.php with the following code:

<?php if(is_category()) : ?>
<a href="<?php echo bloginfo("url") . "/wp-rss2.php?cat=$cat" ?>">Subscribe to the <?php single_cat_title(); ?> category</a>
<?php endif; ?>

Cool eh!

Comments

  • July 30th, 2008 at 10:13 am

    Thank for that code.

Your Comment