I have a custom field called "sale_status" and the values ("For Sale", "Sold", "Let") are displayed in a radio button in admin. Now each of them can be assigned to a single property.
Currently the query fetches the properties order by post date but I want it to be by sale_status and then date.
My code is as below--
$args = array(
'post_type' => 'zoo-property',
'posts_per_page' => $query__per_page,
'post_status' => 'publish',
'paged' => $query__page,
'meta_key' => 'sale_status',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'meta_query' => array(
'relation' => 'AND',
$query__types,
$query__locations,
$query__statuses,
$query__investments,
$query__price
)
);
$properties_wp_query = new WP_Query($args);
echo "Last SQL-Query: {$properties_wp_query->request}";
But it not showing in correct order.
Any help is highly appreciated. Thanks in advance.