nyc_derek
4/1/2016 - 2:54 AM

Basic Gallery

Basic Gallery

This example will loop over the selected images and display a list of thumbnails which each link to the full size image.

<?php 

$images = get_field('gallery');

if( $images ): ?>

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