Hi! Thank for such a prompt response.
I’ve been spending the afternoon figuring out how to show url and attachment image using Advanced Custom Fields. It turned out to be wickedly simple.
I just need to know what class or data I need to add to the fig to make all the images in the same repeater field a gallery. Then, using the link you shared I can add the fancybox-hidden class and unhide the first-child.
Does that sound about right?
Here’s my code:
<?php
$args = array( 'post_type' => 'transducer-photo', 'posts_per_page' => -1, 'transducer-type' => 'input-type' );
$the_query = new WP_Query( $args );
?>
<?php if ( $the_query->have_posts() ) : ?>
<article class="transducer-photo-list input">
<h2 class="transducer-list-title"><?php $term = get_term( 21, 'transducer-type' ); echo $term->name; ?></h2>
<ul>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<li class="transducer-type">
<h3 class="transducer-title entry-title"><?php the_title(); ?></h3>
<?php if( have_rows('transducer_type_photos') ): ?>
<?php while( have_rows('transducer_type_photos') ): the_row(); ?>
<?php
$attachment_id = get_sub_field('transducer_photo');
$url = wp_get_attachment_url( $attachment_id );
$size = 'transducer-thumb'; // (thumbnail, medium, large, full or custom size)
?>
<fig class="fancybox">
<a href="<?php echo $url; ?>"><?php echo wp_get_attachment_image( $attachment_id, $size); ?></a>
<figcaption><?php the_sub_field('transducer_photo_caption'); ?></figcaption>
</fig>
<?php endwhile; ?>
<?php endif; ?>
</li>
<?php endwhile ?>
</ul>
</article>
<?php endif; ?>