Home › Forums › Add-ons › Gallery Field › Gallery Field inside a Repeater field › Reply To: Gallery Field inside a Repeater field
Don’t be mad its working a charm. Used this with OWL Carousel 2, really good.
Only posting the PHP so you can grab it.
// check if the repeater field has rows of data
if( have_rows('repetidor_imagenes') ):
// loop through the rows of data
while ( have_rows('repetidor_imagenes') ) : the_row();
// Start Loop
// Grab the subfield gallery array
//(Use the array return on ACF backend panel, you will have more control con the atts)
$images = get_sub_field('geleria_de_imagenes');
if( $images ):
$output .= '<div class="vc_row wpb_row vc_row-fluid prodvar imgal-container">';
$output .= '<div class="owlonlyfix owl-carousel owl-theme">';
foreach( $images as $image ):
$output .= '<div class="item imgal-img"><img src="'.$image['sizes']['thumbnail'].'" alt="'.$image['alt'].'" class="imgal-img" /></div>';
endforeach;
$output .= '</div></div>';
endif;
// End Loop
endwhile;
else :
// no rows found
endif; ?>
Cheers!!!
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.