Chronologically ordered blog in wordpress

I recently started the FedDibblety house blog, documenting our home improvements to our new home in Indiana (which Clare’s parents built). I set up accounts for my wife Clare, her parents, Dave and Ellen, and my parents, Harold and Fran. Ellen, being a technology nut like myself, immediately jumped in writing posts about the house, and also had some feature requests. One of those features was to have the blog read in chronological order. Most blogs read in reverse chronological order, but since this one was kind of diary-esque, it seemed more appropriate to have it in normal order. I am also dating posts corresponding to the improvements made, not the actual post date. I started searching around for forum posts and such about how to do this, and I came across two relevant ones. I came across one post on which had a very simple solution, of simply adding one line to the index.php file in the root directory, like so:

/* Short and sweet */
define('WP_USE_THEMES', true);
$order = 'ASC'; //adding this line

This did exactly as one would expect. However, this also caused some problems. For those avid blog readers, now they would have to scroll way down (or go the archives) to see new posts, which doesn’t really make sense. In addition, the RSS feed was also chronologically ordered, so that RSS users would find it very difficult to see if the blog had been updated recently. While searching I also found another post on, in which the blogger asked the same question, and a reply by Jeff Licquia suggested a very simple solution:

To set up archives to use a different template, go into the management page, then go to Options, then Permalinks.

If you can’t, or don’t understand, the RewriteRules stuff, look at the note about not being able to use mod_rewrite. Where it says:


Change “index.php” to something else, like “archives.php”, and put that in for the virtual site structure. Copy index.php to archives.php in your document root, then add the special flag to archives.php. You should be all set at that point.

(I’m a newbie to WordPress, but not to Web servers or Web stuff in general, so the above makes sense to me but isn’t tested. I’ll try to help if you have problems.)

This idea worked very well. I made the change in the WordPress options page, then copied index.php to archives.php, using the $order=ASC flag, and removed that from index.php. Then I had to change the .htaccess file to direct queries to archives.php. I did not want to do this for feeds though, so I had to put in two rules, like so:

#.htaccess file for fedibblety/house blog
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /house/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !.*feed\/?$ [NC]
RewriteRule . /house/archives.php
RewriteCond %{REQUEST_FILENAME} .*feed\/?$ [NC]
RewriteRule . /house/index.php

Then there was one last thing. In that blog (and in this one), I am using the fancy-archives plugin (as I write this post that site seems to be down, so I am not providing a link), which I have tweaked a bit. To get the archives in the sidebar listed in chronological order, I just had to change the SQL queries in the fancy-archives-list.php file to ORDER BY post_date ASC.

That was it!

This entry was posted in (x)html, php, sql, wiki/cms. Bookmark the permalink.

9 Responses to Chronologically ordered blog in wordpress

  1. Do you have the url for that fancy-archives plugin you mentioned yet? That sounds very interesting.

  2. robfelty says:


    I have released an updated and improved version of the fancy-archives plugin which I now call “collapsing archives”. It is available on

    Thanks for reading.


  3. Sreedinesh says:

    Hey i want that url of the plugin that you have mentioned right away!

  4. Nice post. I’m also interestes in that plugin, can i have it too ….thanks

  5. Armour says:

    Will this plugin would be effective? Jus check out and help me!

  6. Data Storage says:

    – It’s always interesting to read about how one upgrades their home because sometimes, they not only blog the steps in a particular task, but actually put forth actual instruction so others may try it out as well.
    – WordPress is really the best way to go about it in my book because they make it idiot-proof to set up a good-looking blog w/o making any major errors (if you follow the instructions to the tee)
    – I liked how you set up your archives in chronological order. I never bothered to do it on my blogs before, but I’m going to impliment it now with the code you graciously shared w/ is. Thanks!

  7. Sebastian says:

    Thanks for the chronological archive fix, just what I need :) (I’m surprised WordPress doesn’t provide it as a base option, and no one’s made a plugin either!)

  8. Joe Harkins says:

    I searched for hours, looking for a plugin or any simple way of restoring the true chronological order to my travel journal. I found pages and pages of incomplete, outdated and plain old geeky stuff.

    Until I found your simple on line of code

    $order = ‘ASC’;

    inserted into the root index.php.

    Works perfectly.

    Thank you.

  9. thanks you, thanks for your kind posting! This is really heloful.