meta_query order by multiple keys
-
Hi all
just wanted to sort some meta values with meta_query. order by just one is easy. but order by two? (for ex. first order by ‘datum’ and then order by ‘zeit’)
my code looks like this:
$args = array( 'post_type' => 'events', 'posts_per_page' => 30, 'meta_query' => array( array( 'key' => 'datum', ), array( 'key' => 'zeit', ) ), 'meta_key' => 'datum', 'orderby' => 'meta_value_num', 'order' => 'ASC' ); $loop = new WP_Query( $args );
could not find any solution for multiple ordering anywhere ??
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘meta_query order by multiple keys’ is closed to new replies.