Ok… so I’ve tried it a few different way and am still missing it.
I checked my database and here is what my Hello World! post has in it for directory_news:
So that’s showing me that profiles with the ID of 65 and 23 are linked to that post…
So then I thought I followed the example that you provided with this
$mine = get_posts(array( 'post_type' => 'post', // "post" because I'm calling regular blog posts? 'meta_query' => array( array( 'key' => 'directory_news', // slug of custom field 'value' => '65', // hardcoded it just to test 'compare' => 'LIKE' ) ) ));
You’ll see that instead of using the ID I just hardcoded 65 in there just to see if I could only pull that one…
However this still spits out ALL posts.. and not the ones that have David in the relationship field.
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!
© 2023 Advanced Custom Fields.