Support

Account

Home Forums Add-ons Repeater Field Is there a way to separate repeater rows by groups of five? Reply To: Is there a way to separate repeater rows by groups of five?

  • Ok, this is what I mean.

          <div class="tabz">
          
    <?php if( have_rows('employees') ): ?>
          <ul class="employees">
    <?php $count = 1; ?> 
    <?php while ( have_rows('employees') ) : the_row(); ?>
              
              <li><a href="#employee-<?php echo $count; ?>" style="background-image: url(<?php the_sub_field('photo'); ?>);"><div class="hover"><?php the_sub_field('title'); ?></div></a><strong><?php the_sub_field('name'); ?></strong></li> 
    
    <?php $count++; endwhile; ?>
            </ul>
    <?php endif; ?>
              
              
    <?php if( have_rows('employees') ): ?>
    <?php $count = 1; ?> 
    <?php while ( have_rows('employees') ) : the_row(); ?>            
          <div id="employee-<?php echo $count; ?>" class="employee-bio">
            <div class="row">
              <figure style="background-image: url(<?php the_sub_field('photo'); ?>);"></figure>  
              <article>
                <h2><?php the_sub_field('name'); ?></h2>
                <h3><?php the_sub_field('title'); ?></h3>
                
                <?php the_sub_field('biography'); ?>
    
              </article>
            </div>
          </div>  
    <?php $count++; endwhile; ?>
    <?php endif; ?>
              
          </div>

    I want to run both for every 5 rows