Put RSS feed in default order (2 posts)

  1. CHUD
    Posted 11 years ago #

    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?

  2. Kafkaesqui

    Posted 11 years ago #

    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).

Topic Closed

This topic has been closed to new replies.

About this Topic