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
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.