Home › Forums › Add-ons › Repeater Field › How to limit the records output from a basic repeater loop? › Reply To: How to limit the records output from a basic repeater loop?
EDIT –
It actually is working sorry! It wasn’t displaying for an entirely different reason
Apologies
*** original question ***
Hi John
I know this solution is really old but is it still valid?
I am trying to get it to work with a slider using a repeater field from an ACF options page like below but it returns nothing?
I cant see what I am doing wrong
<section class="latest-publications">
<h2>Latest Publications</h2>
<div class="pink-divider"></div>
<div class="publications-row">
<div class="posts-carousel">
<?php if (have_rows('publication', 'option' )) {
$count = 1;
while (have_rows('publication', 'option')) {
the_row();
?>
<div class='publication-slide'>
<a href="/publications#<?php echo sanitize_title( get_sub_field( 'publication_title' )); ?>" target="_blank"><?php the_sub_field( 'publication_title' ); ?></a></h4>
<?php the_sub_field( 'publication_description' ); ?>
<p class="icon-date"><?php the_sub_field( 'date' ); ?></p>
</div>
<?php $count++;
if ($count > 3) {
break;
}
}
}
?>
</div>
</div>
</section>
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.