I would like to show only the first row of a repeater that is on another page. can someone help me with the code?
here is my code so far
<?php if (have_rows('version', 10081)): ?><?php while (have_rows('version', 10081)) : the_row(); ?>
<div class="row row-download row-download<?php echo get_row_index(); ?>">
<div class="col-md-2">
<?php the_sub_field('version_number'); ?>
<?php endwhile; ?><?php endif; ?>
Thanks!
<?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.