I knew you get an RSS feed for posts with a specific tag in Wordpress 2.3. But did you know you can get an RSS feed for a search too? Neither the tag nor the search rss feed seem to be really support by template tags so you can’t really access them normally within a theme or from a Wordpress enabled webpage.
BTW If you have a site using FeedBurner to wrap RSS feeds and you are using FeedBurner FeedSmith plugin, then this won’t work. This plugin will wrap your posts RSS feed and ignore tag and search distinctions. I did a bit of hacking in th version of this plugin I use on this site to make this post work.
To get an RSS feed for posts with a specific tag, go to the tag archive and, if the site is using fancy permalinks, add “/feed/” to the end of the url. If it’s not using fancy permalinks, add “&feed=rss2″ instead. You can tell a site is not using fancy permalinks if the tag archive URL is like this: http://[site-url]/?tag=tag_slug (i.e. it contains a “?”).
For example: the URL for any posts tagged with Wordpress on this site is:
The non-fancy-permalink version would be:
Now to get an RSS feed for that tag you change the URL like this for fancy permalinks:
Change the non-fancy permalink like this:
For search, it’s slightly simpler as there does not seem to be a fancy permalink for searches. So do a search for wordpress on my site (you can use the searchbox up there in the top). You’ll end up with a URL like this:
Now just add “&feed=rss2″ to the end and you get a feed for any posts on my blog that mention wordpress.
This feed will pick up any post I happen to mention the word “Wordpress” in.
Quite neat isn’t it? Now if there was some proper template tags for these feeds I’m sure more themes would natively support them.
What’s the use of using a search rss feed over a tag rss feed? Well you want your blog posts the way you want to read them don’t you? For example, I do not always tag any post about “wordpress,” I only tag those that are relevant to that. So, there you go!
Popularity: 4% [?]