Home › Forums › Add-ons › Repeater Field › Query repeater field with two values › Reply To: Query repeater field with two values
Please could you help me figure out how to run a WP_Query with meta_query such that posts-types are filtered by a subfield within a group field.
I have a custom post type of image and an acf group field of authors with a subfield of people. People is a multi-select post_object field. What would I need to do to get images only where people contains a certain id?
I’m trying something like this based on John Huebner’s comment above.
$images_query = new WP_Query([
'posts_per_page' => -1,
'post_type' => 'images',
'meta_query' => [
[
'key' => 'authors_%_people',
'value' => ['85'],
'compare' => 'IN'
],
],
]);
I’ve clearly got something wrong, Nothing is working. Please help.
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!
🎉ACF has made it into the latest round of the @TheTorqueMag Plugin Madness!
— Advanced Custom Fields (@wp_acf) March 22, 2023
🙏 Please swing by and vote for ACF in the latest matchup.
🙌 Each round lasts one week, but you can vote twice each week. Make sure to get both your votes in!https://t.co/iTpRE82O1k
© 2023 Advanced Custom Fields.
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.