I had the same problem where passing multiple arrays for the same key wasn’t working. Instead, just use one array, set ‘value’ to an array of values, and set ‘compare’ to IN:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <?php $args = array( 'meta_query' => array( array( 'key' => 'key1', 'value' => array('value1', 'value2'), 'compare' => 'IN' ), ) ); $query = new WP_Query( $args ); ?> |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.