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
}
}
}
}
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 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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.