Title: Multiple sorting parameters in query_posts?
Last modified: August 19, 2016

---

# Multiple sorting parameters in query_posts?

 *  [Doug](https://wordpress.org/support/users/zonglars/)
 * (@zonglars)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/multiple-sorting-parameters-in-query_posts/)
 * Is it possible to pass multiple orderby values in the query_posts? I want to 
   display the first 3 entries of my products custom post-type, and prioritize to
   list the ones with higher ratings (a custom field value), but also be random,
   so it’s not showing the same 3 posts every time. Is there a way to do this?
 * On the other hand, would it be easier to create a custom taxonomy for the rating,
   and only query posts from the higher rating categories? But how would I have 
   it check lower ratings if there weren’t enough in the highest category?

The topic ‘Multiple sorting parameters in query_posts?’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [meta_value)](https://wordpress.org/support/topic-tag/meta_value/)
 * [multiple values](https://wordpress.org/support/topic-tag/multiple-values/)
 * [orderby](https://wordpress.org/support/topic-tag/orderby/)
 * [post-type](https://wordpress.org/support/topic-tag/post-type/)
 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Doug](https://wordpress.org/support/users/zonglars/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/multiple-sorting-parameters-in-query_posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
