Support » Fixing WordPress » query post order by parameters

Viewing 9 replies - 1 through 9 (of 9 total)
  • Sorry it means from the most recent to the oldest, of course

    The template used is determined by the ‘Template Hierarchy‘.

    If you are not using a Static Front Page, and your theme has no home.php file, then the Home page will use index.php as the template.

    BTW, ‘most recent to oldest’ is the default behaviour in most themes, that is order=’DESC’ (older posts have LOWER dates). Perhaps your theme has an option to change the order.

    But I am not talking about the homepage, I am talking about the category posts. The listing of posts in the category pages should be from the oldets (at the top) to the newest at the bottom. I checked, and there is no DESC option in my template (Atahualpa).
    The only solution seems to install a plugin, which I’d prefer to avoid if possible.

    I just installed Atahualpa on my test site. You need to create an Archives Page, and set the category order there.

    Go to Admin->Atahualpa Theme Options->CREATE ARCHIVES PAGE and follow the instructions.

    EDIT: Sorry, that didn’t work either!

    Oh 🙁
    Well, thank you for trying!

    Alright, I got it to work, but you will need to modify the theme. You probably should create a child theme so your changes will not get wiped out when you update the theme.

    There is probably a better way to do this, but this should work. In index.php, insert new lines above /* If there are any posts: */, like this:

    <?php if (is_category()) {
       query_posts(array_merge($wp_query->query,array('order' => 'ASC')));
       $bfa_ata['multi_next_prev_newer'] = '&laquo; Older Entries';
       $bfa_ata['multi_next_prev_older'] = 'Newer Entries &raquo;';
    <?php /* If there are any posts: */

    Hey! It works!
    Thank you very much, this has been very helpful 🙂

    Glad it worked! Now, please use the dropdown at top right to mark this topic ‘Resolved’.

    Done. Thanks again

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘query post order by parameters’ is closed to new replies.