Support

Account

Home Forums General Issues Display Gallery images meta data on front end Reply To: Display Gallery images meta data on front end

  • That’s great thank you.

    I am using the following solution after experimenting:

    <?php
        $images = get_field( 'gallery' );
         if( $images ): ?>
    	<?php foreach( $images as $image ): ?>
    	<?php $image_large = wp_get_attachment_image_src($image['id'], 'large'); ?>
            <?php $image_thb = wp_get_attachment_image_src($image['id'], 'thumbnail', $image['caption']); ?>
    	
    <div class="eventGal">
            <a href="<?php echo $image_large[0]; ?>" rel="lightbox[gallery]">
              <img src="<?php echo $image_thb[0]; ?>" class="attachment-thumbnail" /></a>
    	<h3><?php echo $image['title'];?></h3>
    	<p><?php echo $image['caption']; ?></p>
    </div>
    	<?php endforeach; ?>
    <?php endif; ?>

    Thanks for your help