[Plugin: Advanced Custom Field] Displaying only the FIrst Row in Repeater
-
Hi,
I have multiple images in a repeater, and I’d like to show only the first image. I found this posting and tried, but I’ve had no luck;
This is my code;
<div class="column-img"> <?php if(get_field('gallery')): ?> <?php while(the_repeater_field('gallery')): ?> <div id="externalnav"><div class="postitem"><div class="background"></div> <a href="#" class="imghover"><img src="<?php the_sub_field('image'); ?>"/> </a> <?php $first_number = get_sub_field('image'); $second_number = get_field('title'); $num1 = (int)$first_number; $num2 = (int)$second_number; $total = $num1 * $num2; print number_format($total); ?> </div><!--.postitem --> </div><!--externalnav--> </div><!--column-img--> <?php break; ?> </div><!--wrapper --> <?php endwhile; ?> <?php endif; ?>
Please help!
Thanks,
Jaeeun
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: Advanced Custom Field] Displaying only the FIrst Row in Repeater’ is closed to new replies.