jcadima
8/17/2016 - 5:35 PM

FlexSlider get first Image, gallery custom field

FlexSlider get first Image, gallery custom field


<?php 
$images = get_field('gallery'); // get gallery
$image  = $images[0]; // get first image in the gallery [1] for second, [2] for third, and so on.

if( $image ) : // only show the image if it exists ?> 
    <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
<?php endif; ?>