Ok, that’s an example for gallery:
<?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'); ?>
<a href="<?php echo $image_large[0]; ?>" rel="lightbox[gallery]">
<img src="<?php echo $image_thb[0]; ?>" class="attachment-thumbnail" />
</a>
<?php endforeach; ?>
<?php endif; ?>
Thanks, but I’m not doing galleries.
I have an Advanced Custom Field that is set to image, and i’m inserting it into my page template like this:
<img src=”<?php the_field(‘bio_pic_one’); ?>”>
And I’d like to somehow add a light box to that. Is it possible with this plugin?
That is just an image, it doesn’t link to anything so can’t have lightbox applied. If you make one image (e.g. thumbnail) link to a second image (e.g. large) and you add a rel=”lightbox” attribute to that link the lightbox effect will be applied (and generally possible).
This code works great for a gallery field.
I tried to modify it to use it inside a repeater field. Several tries, no success.
Could someone show me how?
Thanks,