Support

Account

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',