Hello,
I’m building my very first project with Kirby and learning a lot by doing so
However, I ran into the following problem:
For a slideshow, I need the first image to have an additional class (“visible”). This is my code:
<?php foreach ($gallery as $image): ?>
<?php if($image->isFirst() === true): ?>
<figure class="slide-projekt visible">
<img src="<?= $image->url() ?>">
</figure>
<?php else: ?>
<figure class="slide-projekt">
<img src="<?= $image->url() ?>">
</figure>
<?php endif ?>
<?php endforeach ?>
I have a folder with 12 images, and the generated HTML code assigns the “visible” class to the sixth instead of the first.
What am I doing wrong?
Many thanks!