Site icon Hip-Hop Website Design and Development

ACF: Solely get first row of a Repeater Area

I’ve a repeater filed referred to as "images" and inside it I’ve a sub_filed referred to as "image".

How can I get solely the primary row worth?

Right here is my code

<?php if( have_rows('photos') ): ?>
<?php
$lively = 'lively';
whereas ( have_rows('photos') ) : the_row();
$picture = get_sub_field('picture');
if($picture == "" ) proceed;
?>
<img src="<?php echo get_template_directory_uri(); ?>/files/images/<?php the_sub_field('image'); ?>" class="img-fluid is-slider-item" />
<?php $lively = '';
endwhile;
?>
<?php endif; ?>

What I attempted

<?php
$lively = 'lively';
whereas ( have_rows('photos') ) : the_row();
$picture = get_sub_field('picture');
if($picture == "" ) proceed;
?>
<img src="<?php echo get_template_directory_uri(); ?>/files/images/<?php the_sub_field('image'); ?>" class="img-fluid is-slider-item" />
break;
<?php $lively = '';
endwhile;
?>
<?php endif; ?>

Many thanks upfront!