Answer the question
In order to leave comments, you need to log in
Why is flexslider 2 initialization inside ACF Repeater not working?
Hello!
Created ACF repeater with Gallery field type. For each gallery flexslider 2 should be displayed. But the slider is shown only for the first gallery.
Slider link - flexslider.woothemes.com Slider
initialization code:
jQuery(window).on('load', function() {
// flexslider android
jQuery('#carousel_android').flexslider({
animation: "slide",
animationLoop: true,
itemWidth: 150,
itemMargin: 10,
maxItems: 4,
slideshowSpeed: 4000,
controlNav: true
});
});
<?php if( have_rows('android_os') ):
while ( have_rows('android_os') ) : the_row(); ?>
<?php
$images = get_sub_field('android_screenshots');
$size = 'md7_blog';
if( $images ): ?>
<div id="carousel_android" class="flexslider">
<ul class="slides">
<?php foreach( $images as $image ): ?>
<li>
<?php echo wp_get_attachment_image( $image['ID'], $size ); ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</div>
<?php endwhile;
else :
// no rows found
endif; ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question