Sep 052008
 

On my craft­ing 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, say­ing that Word­Press 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 plu­gin to do it?). Then I dis­covered that this blo­g’s default feed had been changed to RSS2 some time when I was­n’t look­ing, which also was­n’t what I wanted. 

To jog my memory next time I upgrade Word­Press and want to use Atom by default, here’s where to change the set­ting. For­tu­nately PHP code is easy to search through! The file is feed.php in the wp-includes dir­ect­ory. Change the second para­met­er in the get_default_feed func­tion to atom. With­in any luck this meth­od will even con­tin­ue to work in the next ver­sion. I’ll cer­tainly know to check what the default feed format is in the future.

  2 Responses to “WordPress and Atom”

  1. It’s not in Word­Press as an option, but you can set your default feed type with a plu­gin, which should be easi­er to main­tain than edit­ing the code. Some­thing 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);
    ?>

  2. I was very happy when I switched to using svn to man­age my WP install­a­tion: upgrad­ing is now a single svn switch com­mand plus going to the upgrade.php web page (plus back­ing up my data­base first, just in case), and it trans­par­ently pre­serves changes like this.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

/* ]]> */