Support

Account

Home Forums Add-ons Repeater Field Query only first row in repeater Reply To: Query only first row in repeater

  • <?php if (have_rows('version', 10081)): ?>
    
    	<?php $start = 1; $end = 1; ?> <!-- start and ending number -->
    
    	<?php while (have_rows('version', 10081)) : the_row(); ?>
    	
    	<?php if( $start <= $end ): ?> <!-- if start <= ending number, show -->
    		<div class="row row-download row-download<?php echo get_row_index(); ?>">
    		<div class="col-md-2">		
    		<?php the_sub_field('version_number'); ?>
    	<?php endif; ?>
    	
    	<?php $start++; ?> <!-- start + 1 -->
    	
    	<?php endwhile; ?>
    
    <?php endif; ?>

    Count your entries and only show the first entry.