Home › Forums › Feature Requests › Post_object post › Reply To: Post_object post
If the post object field can only have one value then what you have should work. It will not work if your post object field allows multiple selections. If that’s the case then you need to change the meta query to
$args = array(
'post_type' => 'post',
'posts_per_page'=> -1,
'meta_query' => array(
array(
'key' => 'attraction_in',
'value' => '"'.$post_id.'"',
'compare' => 'LIKE'
)
)
);
this is explained in the “single-location.php” section of this page https://www.advancedcustomfields.com/resources/querying-relationship-fields/
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.