• Hi guys,

    On my category page i am trying to change the order of the posts displayed. Currently they are listed in order based on ID. I would like to change this so it orders them by the last time they modified. My current code is as follows.

    <?php
    global $query_string;
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts($query_string.'&paged='.$paged.'&posts_per_page=60');
    ?>

    How do i amend this so it orders by ‘modified’ in descending order?

    Thanks

Viewing 1 replies (of 1 total)
  • Try adding the orderby and order parameters to the query_posts() call:

    query_posts($query_string.'&paged='.$paged.'&posts_per_page=60' . '&orderby=modified&order=DESC');
Viewing 1 replies (of 1 total)
  • The topic ‘Help needed with 'orderby' when dealing with pages.’ is closed to new replies.