I'm stuck with this since this morning. I’m trying to order with two custom key in a custom post type.
$args = array(
'post_type' => 'my_new_post_type',
'meta_query' => array(
'relation' => 'AND',
'firstArray_clause' => array(
'key' => 'my_first_key',
'value' => 'My first value',
'compare' => 'EXISTS',
),
'secondArray_clause' => array(
'key' => 'my_second_key',
'compare' => 'EXISTS',
),
),
'orderby' => array(
'firstArray_clause' => 'ASC',
),
);
$MyQuery = new WP_Query( $args);
So for "my_first_key" I just want it to exist and I want to order by the value of "my_second_key". Thanks a lot