Home › Forums › General Issues › Looping through a group with a nested repeater › Reply To: Looping through a group with a nested repeater
Update: I have started to shift toward adding meta_query to my args and then put an if $count is greater than the query. My issue is that I can only get the $count to add up how many posts are in the CPT, instead of what matches the query. Have I gone the wrong way?
Here is the new code I am trying to make work:
$args = array( 'posts_per_page' => 500, 'orderby' => 'meta_value', 'order' => 'DESC', 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'book_videos', // group 'compare' => 'EXISTS' ), array( 'key' => 'book_videos_bk_videos', // group + nested repeater --> I want to add another array here that adds in a subfield of the nested repeater but it just doesn't work 'compare' => 'EXISTS' ), ), 'post_type' => 'books', 'post_status' => 'publish',
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’re hard at work on ACF 6.1, and Beta 1 is now available 🚀— Advanced Custom Fields (@wp_acf) March 16, 2023
This release includes custom post type and taxonomy registration, an improved experience when selecting field types, PHP 8.1 and 8.2 compatibility, and more!
Let’s take a look 🧵https://t.co/Y0WcAT11l4
© 2023 Advanced Custom Fields.