Filter by one custom field, order by another?

Posted by Prem Tiwari | Updated on

You could use the query to filter the content as you intended by using the ‘meta_query’ with filtering options, and for the order part, just add/modify the following parameters:

1. ‘orderby’ => ‘meta_value’
2. ‘meta_key’ => ‘location_level1_value’
3. ‘order’ => ‘ASC’

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers