WordPress is a great platform for people who are just starting out with RSS. Automatically-generated feeds take the guesswork out of picking and choosing content, as well as coding clean XML. However, many websites have need of much more detailed feeds than what WordPress provides. For example, central banks worldwide have adopted an RSS standard known as RSS-CB, used for displaying a variety of specific information like exchange rates, speeches and news. A lot of additional fields are required to meet the RSS-CB specifications.

Enter custom RSS templates. By coding an RSS template from scratch, it’s entirely up to the developer which fields to use and what information to populate them with. Custom templates also allow a website to have different types of feeds for the same content, e.g. both RSS 2.0 and RSS-CB for press releases. The More Fields plug-in is an asset here, as custom metadata can be pulled in either to populate additional fields like RSS-CB’s <cb:venue> , or to simply include in the <description> section of an RSS 2.0 feed.

The starting point for creating these feeds was a very brief tutorial we found in a Google search: Custom RSS feeds in WordPress. Skipping the FeedBurner part, we created a general RSS page template, stuck it on a page and voila! RSS displayed exactly the way we wanted it. It would have been cumbersome to create individual pages for all the different types of content on the website, so a redirect rule was added to the .htaccess file to reroute all /feed/ URLs to one central RSS hub:

RewriteRule (.*)feed/(rss2|rss-cb){0,1}/{0,1}$ bc-rss/?f=$1&t=$2 [R=301,L]

This rule handles feeds for authors, tags and most importantly categories, taking the information type, slug and RSS type ( rss2 or rss-cb are specified here) from the URL and flipping them around into usable GET parameters. Using these parameters, a WordPress post query can be built fairly simply to return all the necessary data to populate any given RSS schema, all in one template. That can get a little crowded though.

Enter the Carrington theme. Carrington automates the selection of customized templates based on categories. Using Carrington isn’t necessary to get custom RSS running smoothly – you can always have multiple WordPress pages for multiple RSS templates – but if you are looking for a new theme or already using Carrington, take advantage of it.

By creating a custom loop for each type of RSS, we were able to use Carrington’s built-in functionality to select a highly customized RSS template based on both RSS type and category. Now we can display all of our regular content in appropriate RSS 2.0 feeds, as well as central bank crawler content in valid RSS-CB feeds. Adding new feeds is easy as creating a new template file.