Support

Account

Home Forums ACF PRO Featured Image from Gallery via ACF Form Reply To: Featured Image from Gallery via ACF Form

  • I’m assuming from looking at your code that “listing_media” is the repeater.

    if this is inside a group field then you also need to loop over the group field.

    You also need to supply the post ID inside of the function for the first field.

    
    if (have_rows('group_field_name', $post_id)) {
      while (have_rows('group_field_name', $post_id)) {
        the_row();
        if (have_rows('listing_media')) {
          while (have_rows('listing_media')) {
            the_row();
            $gallery  = get_sub_field('listing_image_gallery', false, false);
            // etc
          }
        }
      }
    }