On my crafting blog I use the Tarski theme, and that used to give you the choice between Atom and RSS for the feeds. Then they took it out, saying that WordPress itself gives you the choice. Well, maybe it does (or maybe it did), but nowhere in the options for 2.6.1 that I could find (maybe you need a plugin to do it?). Then I discovered that this blog’s default feed had been changed to RSS2 some time when I wasn’t looking, which also wasn’t what I wanted.
To jog my memory next time I upgrade WordPress and want to use Atom by default, here’s where to change the setting. Fortunately PHP code is easy to search through! The file is feed.php
in the wp-includes
directory. Change the second parameter in the get_default_feed
function to atom
. Within any luck this method will even continue to work in the next version. I’ll certainly know to check what the default feed format is in the future.
It’s not in WordPress as an option, but you can set your default feed type with a plugin, which should be easier to maintain than editing the code. Something like this should work:
<?php
/*
Plugin Name: Default to Atom Feed
Description: This plugin replaces the default RSS feed with the Atom 1.0 feed.
Version: 0.1
*/
remove_action("do_feed_rss2", "do_feed_rss2", 10, 1);
add_action("do_feed_rss2", "do_feed_atom", 10, 1);
?>
I was very happy when I switched to using svn to manage my WP installation: upgrading is now a single svn switch command plus going to the upgrade.php web page (plus backing up my database first, just in case), and it transparently preserves changes like this.