Hi John, thanks for your reply!
By before the loop, I mean before
while(have_rows()). This is my current setup; looking to insert my count as in double brackets:
<?php if( get_row_layout() == 'flex_field' ): if( have_rows('repeater') ): ?> <div class="repeater-wrapper [[ECHO REPEATER ROW COUNT HERE]]"> <?php while ( have_rows('repeater') ) : the_row(); ?> <div class="repeater-row"> <p><?php the_sub_field('repeater_row_content'); ?></p> </div> <?php endwhile; ?> </div> <?php endif; endif; ?>
Apologies if my syntax is a bit messy. Any thoughts on how your solution might work in this instance?
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!
© 2023 Advanced Custom Fields.