Support » Installing WordPress » Put RSS feed in default order

  • I wanted my archives and categories to show up in ascending chronological order so I put the following code in my index.php:

    if (!empty($_SERVER["QUERY_STRING"]))
    /* Short and sweet */
    define('WP_USE_THEMES', true);

    It worked like a charm, so now my main page has the most recent post up top and goes in descending order but everything else is ascending. Just what I wanted.

    But. Now my RSS feed is in ascending chronological order too, so my oldest entry is what’s showing up first. Not what I want there.

    How can I get the RSS to stream normally (reverse chrono order) and still have my archives in ascending order?

Viewing 1 replies (of 1 total)
  • What I would recommend, since you’re using custom permalinks, is to remove $order from your blog root index.php, and place this at the end of each of the category and archive RewriteRule lines in your .htaccess:


    For example:

    RewriteRule ^category/(.+)/?$ /index.php?category_name=$1&order=asc [QSA,L]

    Ignore any of the lines with ‘feed’ in it…

    Note: Make sure to backup your .htaccess before doing this (in case of a mistype or whatnot).

Viewing 1 replies (of 1 total)
  • The topic ‘Put RSS feed in default order’ is closed to new replies.