OC_Dev
6/29/2018 - 10:27 AM

ACF Limit Output

Set a loop limit for Advanced Custom Fields that breaks output after a certain threshold is met

<?php if( have_rows('cb_one-2' , 52) ): ?>
<?php $i = 0; ?>
<?php while ( have_rows('cb_one-2' , 52) ) : the_row(); ?>

<?php $i++; ?>
<?php if( $i > 3 ): ?>
<?php break; ?>
<?php endif; ?>