Title: Sorting records
Last modified: July 19, 2023

---

# Sorting records

 *  [almsit](https://wordpress.org/support/users/almsit/)
 * (@almsit)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/sorting-records/)
 * Hello. I have a query:
 *     ```wp-block-code
       $args = array( 'cache_results' => false,
   
       'update_post_meta_cache' => false,
   
       'update_post_term_cache' => false,
   
       'post_type' => 'estate_property',
   
       'post_status' => 'publish',
   
       'paged' => $paged, //1
   
       'posts_per_page' => $prop_no, // 10
   
       'meta_key' => $meta_order, // 'empty'
   
       'tax_query' => $tax_array, array[filled array]
   
       'meta_query' => $meta_array, );
       ```
   
 * how can i sort by post_title ? Or by creation date? or by price? (meta property_price)
 * when added to `array ('meta_key' => $meta_order, // 'prop_featured' [orderby]
   => meta_value_num [order] => DESC or ASC)` nothing changes. what to do?
    -  This topic was modified 2 years, 8 months ago by [bcworkz](https://wordpress.org/support/users/bcworkz/).
      Reason: code format fixed
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsorting-records%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/sorting-records/#post-16907207)
 * “orderby” belongs as a key in the main $args array. Do not nest it into any sub-
   array.
    `'orderby'=> 'title',` or `'orderby'=> 'date',` or
 *     ```
       'meta_key' => 'property_price',
       // Do not include a 'meta_value_num' arg key/value pair.
       'orderby'=> 'meta_value_num',
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Sorting records’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/sorting-records/#post-16907207)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
