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.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.