meta_query problem
-
Hey, first of all – thanks for the great plugin.
I use custom layouts with filter for meta-fields. That works fine this way:
function layout_query_args( $query_args, $id ) { $query_args['meta_key'] = 'fieldname'; $query_args['meta_value'] = 'value1'; $query_args['meta_compare'] = 'LIKE'; return $query_args; }
But how can I filter to have fieldname=value1 OR fieldname=value2? I tried it his way but then I get no results:
$query_args = array( 'meta_query' => array( array( 'key' => 'fieldname', 'value' => array( 'value1', 'value2' ), 'compare' => 'in', ) ) );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘meta_query problem’ is closed to new replies.