Home Forums ACF PRO Show First image of gallery Reply To: Show First image of gallery

  • I don’t understand sorry. I get gallery with the next code. How can modify for get/show only first image of gallery? Really thanks!

    $images = get_field('images');
    if( $images ): ?>
        <ul class="imagegallery">
            <?php foreach( $images as $image ): ?>
                    <a href="<?php echo $image['url']; ?>" rel="lightbox">
                         <img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
                    <?php echo $image['caption']; ?>
            <?php endforeach; ?>
    <?php endif; ?>