Hi There, i just want to skip the first image of the gallery field. Now all images will show up. Anyone know how to do this?
This is my actual code.
<?php $gallery_images = get_field('afbeeldingen_gallerij'); ?>
<?php if( $gallery_images ): ?>
<?php foreach( $gallery_images as $image ): ?>
<a href="<?php echo $image['sizes']['lightbox']; ?>" rel="prettyPhoto[<?php global $post; $post_slug=$post->post_name; echo $post_slug; ?>]"></a>
<?php endforeach; ?>
<?php endif; ?>
<?php
$gallery_images = get_field('afbeeldingen_gallerij');
$skip = true;
if( $gallery_images ):
foreach( $gallery_images as $image ):
if ($skip) {
$skip = false;
continue;
}
?>
<a href="<?php echo
$image['sizes']['lightbox']; ?>" rel="prettyPhoto[<?php
global $post; $post_slug=$post->post_name; echo $post_slug; ?>]"></a>
<?php
endforeach;
endif;
?>
Awesome! thank you for the solution 🙂