I'm triyng to display hotels (taxonomy which i have created) by two 'orderby' with wp_query but i'm not success.
Results looks likes:
Hotel 1 : 2 persons 5 stars Hotel 2 : 2 persons 4 stars Hotel 3 : 2 persons 3 stars Hotel 4 : 3 persons 5 stars Hotel 5 : 5 persons 5 stars Hotel 6: 10 persons 2 stars Hotel 7: 10 persons 1 star
The first 'order by' is on the number of persons(the biggest in first) and the second 'order by' is on the rating in stars (so, if several hotels have the same number of persons, the hotel with the biggest stars rating would be in first).
Below my code. I have tried to add an array inside an array with meta_query but it doesn't work.
$args= array( 'post_type' => 'hotel', 'Services' => $Services, 'Town' => $Town, 'meta_key' => 'Number_persons', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'meta_query' => array( array( 'meta_key' => 'Rating', 'orderby' => 'meta_value', 'order' => 'DESC', ) ) ); $the_query = new WP_Query( $args );
Thanks a lot :)