Hello
I can not understand why the gallery does not work if field above is called a simple post
What am I doing wrong?
thank you very much
<!-- post -->
<?php $posts = get_posts( "numberposts=1" ); ?><?php if( $posts ) : ?> <?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
<?php the_post_thumbnail('events-tub'); ?>
<h2 class="featuredTitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<?php endforeach; ?>
<?php endif; ?>
<!-- gallery -->
<?php $images = get_field('field_gallery'); if( $images ): ?>
<?php foreach( $images as $image ): ?>
<div id="gallery" data-toggle="modal-gallery" data-target="#modal-gallery">
<a data-gallery="gallery" class="contimg" href="<?php echo $image['url']; ?>" rel="gallery">
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" /></a>
<?php endforeach; ?>
<?php endif; ?>