Title: sort order problems WP2.0.2
Last modified: August 18, 2016

---

# sort order problems WP2.0.2

 *  [syncbox](https://wordpress.org/support/users/syncbox/)
 * (@syncbox)
 * [20 years ago](https://wordpress.org/support/topic/sort-order-problems-wp202/)
 * 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)

 *  Thread Starter [syncbox](https://wordpress.org/support/users/syncbox/)
 * (@syncbox)
 * [20 years ago](https://wordpress.org/support/topic/sort-order-problems-wp202/#post-398800)
 * I still don’t know why this was behaving this way, but I managed to find a plugin
   whose code I could use to get alphabetical asc sorting and ordering…
 * [http://www.mikesmullin.com/2006/05/23/wordpress-plugin-sort-category-posts-by-title/](http://www.mikesmullin.com/2006/05/23/wordpress-plugin-sort-category-posts-by-title/)
 * using the code in the actual category template before the query rather than as
   a plugin affecting all category posts.

Viewing 1 replies (of 1 total)

The topic ‘sort order problems WP2.0.2’ is closed to new replies.

## Tags

 * [order](https://wordpress.org/support/topic-tag/order/)
 * [query](https://wordpress.org/support/topic-tag/query/)
 * [sort](https://wordpress.org/support/topic-tag/sort/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [syncbox](https://wordpress.org/support/users/syncbox/)
 * Last activity: [20 years ago](https://wordpress.org/support/topic/sort-order-problems-wp202/#post-398800)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
