Quantcast
Channel: Question and Answer » meta-query
Viewing all articles
Browse latest Browse all 36

Query Multiple values for same key

$
0
0

I have tried to get 2 different posts having the values in $al. I can retrieve the posts one at a time but fail to get both together:

$al = array('51.66963','51.60652');

$meta_query[] =  array(
  'meta_query' => array(
   'relation'  => 'AND',
    array(
        'key'     => 'estate_property_google_maps',
        'value'   => $al['0'],
        'compare' => 'LIKE',
    ),
),
  array(
      'key'       => 'estate_property_google_maps',
      'value'       => $al['1'],
      'compare'       => 'LIKE',
      ),
);

Viewing all articles
Browse latest Browse all 36

Trending Articles