blueawesome
1/18/2018 - 1:16 AM

Repeater with Last Class

<?php if(get_field('FIELD')): $i = 0; ?>
	<?php while(the_repeater_field('FIELD')): $i++ ?>
	<?php if($i % 3 == 0){$class = "last";}else {$class = "";} ?>

		<div class="column third <?php echo $class; ?>">

			<?php $img = wp_get_attachment_image_src(get_sub_field('IMG-FIELD'), 'IMG-SIZE'); ?>
			<a href="<?php the_sub_field('service_link'); ?>"><img src="<?php echo $img[0]; ?>" /></a>
			
			<h3><a href="<?php the_sub_field('FIELD'); ?>"><?php the_sub_field('FIELD'); ?></a></h3>
			
			<p><?php the_sub_field('FIELD'); ?></p>
	
		</div>

    <?php endwhile; ?>
<?php endif; ?>