Home › Forums › Add-ons › Repeater Field › Adding class \'active\' to a repeater. › Reply To: Adding class \'active\' to a repeater.
what is your goal?
first should be possible with php without big problems. use something like that:
<div class="quote-section">
<div class="slider4">
<?php if( have_rows('quote_slider') ):
$img_count=1;
while ( have_rows('quote_slider') ) : the_row();
if ($img_count == 1) {
?>
<li class="slide active">
<div class="quote"><?php the_sub_field('quote'); ?></div>
<div class="name"><?php the_sub_field('name'); ?></div>
<div class="image"><img src="<?php the_sub_field('image'); ?>" /></div>
</li>
<?php } else {?>
<li class="slide">
<div class="quote"><?php the_sub_field('quote'); ?></div>
<div class="name"><?php the_sub_field('name'); ?></div>
<div class="image"><img src="<?php the_sub_field('image'); ?>" /></div>
</li>
<?php }
$img_count++; ?>
<?php endwhile;
else : endif; ?>
</div>
</div>
second is/shouldbe part of your slider js, and there i could not help you
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.