WordPress.org

Support

Support » How-To and Troubleshooting » sort order problems WP2.0.2

sort order problems WP2.0.2

  • This is odd. I have a query set up like this:


    <?php
    if (is_category()) { query_posts('cat=50&numberposts=10&order=ASC&orderby=post_title');
    }
    ?>

    and it works… it sorts the posts by the post title, alphabetically from a->z. This is on child of a category (so the categories are crew/current-crew)

    but I put the SAME query on another child category, and the sort is just the opposite! So, using:


    <?php
    if (is_category()) { query_posts('cat=51&numberposts=10&order=ASC&orderby=post_title');
    }
    ?>

    for crew/former-crew, I get titles sorted z->a.

    WTF? Why? And in testing, I just went ahead and changed the ASC to DESC and lo! sorts from a->z

    So I guess I have a solution, but why? I was noticing the same problem with the custom query plugin (which is supposed to allow you to select the number of posts and sort them, but suffered the same issue with sometimes working and sometimes not). That’s why I decided to figure out how to write my own query for it.

    Can someone please explain this behavior or is this just a bug?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘sort order problems WP2.0.2’ is closed to new replies.