Skip to main content
Post Undeleted by Abdulrahman Khaled
Post Deleted by Abdulrahman Khaled
added 12 characters in body
Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

have tried below code to get 2 different posts have same values of this array but fail to get both together I have tried to get 2 different posts having the values in  $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', ), );

. 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',
      ),
);

have tried below code to get 2 different posts have same values of this array 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', ), );

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',
      ),
);
added 2 characters in body; edited body
Source Link

have tried below code to get 2 different posts have same values of this array 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', ), );

$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', ), );

have tried below code to get 2 different posts have same values of this array 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', ), );

have tried below code to get 2 different posts have same values of this array 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', ), );

wrong copy
Source Link

have tried below code to get 2 different posts have same values of this array 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', 'key''value' => $al['1'], 'key''compare' => 'LIKE', ), );

have tried below code to get 2 different posts have same values of this array 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', 'key' => $al['1'], 'key' => 'LIKE', ), );

have tried below code to get 2 different posts have same values of this array 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', ), );

Source Link
Loading