Support

Account

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>