How to order query by multiple meta keys and fields/custom fields?
This is my code:
$args = array
(
'post_type' => 'listing',
'posts_per_page' => -1,
'tax_query' => array
(
array
(
'taxonomy' => 'listing_category',
'field' => 'slug',
'terms' => urldecode($category)
),
array
(
'taxonomy' => 'location',
'field' => 'slug',
'terms' => urldecode($location)
)
),
//*** THIS NOT WORK
'meta_query' => array
(
array(
'key' => 'listing_status',
'orderby' => 'meta_value',
'order' => ASC,
),
array(
'key' => 'listing_total_rank',
'orderby' => 'meta_value',
'order' => DESC,
),
array(
'key' => 'listing_free_date',
'orderby' => 'meta_value',
'order' => ASC,
),
array(
'key' => 'title',
'orderby' => 'meta_value',
'order' => ASC,
),
),
//***
);
$listings = new WP_Query( $args );
The part of 'meta_query'
does not working in the code.