Support

Account

Home Forums Front-end Issues relationship -> query multiple values Reply To: relationship -> query multiple values

  • if i do it manually, i get it to work

    				$args = array(
    						'post_type' => 'maison-hotes',
    						'post__not_in' => $post_id,
    						'meta_query' => array(
    							'relation' => 'OR',
    							array(
    								'key' => 'contact_city', // name of custom field
    								'value' => '"1104"', // matches exactly "123", not just 123. This prevents a match for "1234"
    								'compare' => 'LIKE'
    								),
    							array(
    
    								'key' => 'contact_city', // name of custom field
    								'value' => '"1103"', // matches exactly "123", not just 123. This prevents a match for "1234"
    								'compare' => 'LIKE'
    								),
    							array(
    								'key' => 'contact_city', // name of custom field
    								'value' => '"1105"', // matches exactly "123", not just 123. This prevents a match for "1234"
    								'compare' => 'LIKE'
    								),					
    							array(
    								'key' => 'contact_city', // name of custom field
    								'value' => '"1279"', // matches exactly "123", not just 123. This prevents a match for "1234"
    								'compare' => 'LIKE'
    								),															
    							)
    						);

    so i’m gonna do a foreach to get all my array, but i would like to understand whats wrong on the previous code