Title: query_posts help ~ Need multiple sort by
Last modified: August 19, 2016

---

# query_posts help ~ Need multiple sort by

 *  [salesbcocom](https://wordpress.org/support/users/sales4bcocom/)
 * (@sales4bcocom)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/query_posts-help-need-multiple-sort-by/)
 * I need to query posts so that they sort first by date with the oldest appearing
   first, then by category with the lowest number appearing first. I can’t get anything
   to work. Please help!
 * `<?php query_posts( 'posts_per_page=24&cat=14,15,16,17,18,19&orderby=date&order
   =ASC&orderby=category&order=DESC' ); ?>`
 * _[Please post code snippets between backticks or use the code button.]_

The topic ‘query_posts help ~ Need multiple sort by’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [salesbcocom](https://wordpress.org/support/users/sales4bcocom/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/query_posts-help-need-multiple-sort-by/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
