Home › Forums › Add-ons › Repeater Field › Count Repeater Items › Reply To: Count Repeater Items
To others who have troubles with repeater fields in flexible content
<?php //Flexible content if( have_rows('builder') ) : while ( have_rows('builder') ) : the_row(); if( get_row_layout() == 'shortcuts' ): //Have to make the count before "have_rows" //else it will return false $count = count( get_sub_field('buttons') ); //Repeater field if( have_rows('buttons') ) : while ( have_rows('buttons') ) : the_row(); endwhile; endif; endif; endwhile; endif;
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!
Plugin boilerplates can do some of the heavy lifting during initial development. We look at four options to speed up your plugin creation. https://t.co/ZtMsdBxAHw— Advanced Custom Fields (@wp_acf) June 5, 2023
© 2023 Advanced Custom Fields.