I’ve been trying to create a list of the various feeds available on my site. I created such a list but when my feed reader scans the page for feeds, it lists every single one with the title of my site. This would be fine, but I wanted the title to reflect the names of the categories. It helps no one to have a list of 15 feeds and all of them titled “Taking Your Camera on the Road”. That’s no help.
Note: This only works with RSS 2.0 feeds.
On our new Taking Your Camera on the Road – Feed List, we have listed a variety of the feeds available on our site. One example is to our Learning Zone, our most popular category covering educational material about photography, web, Internet, and more. The feed link looks like this:
The instructions on how to get the category “title” to show up in your RSS 2.0 feeds are as follows.
- Open the
wp-rss2.phpfile in the root directory of your WordPress installation.
- Towards the top of the file, find
<title><?php bloginfo_rss('name') ?></title>.
- Replace it with this:
<title><?php bloginfo_rss('name'); ?><?php if(is_category()) echo ' : ' . wp_specialchars(get_the_category_by_id($cat)); ?></title>
- Save the file and upload it, if necessary, to your server.
Now, this comes with a price. You are changing one of the core programming files for WordPress. When you update WordPress, you will need to do this again. Save a text file in your root directory and in a safe place on your computer with a copy of these instructions so you will remember next time how to change this back.