Hello,
I’m sure that the answer is really simply but I don’t know PHP and with Google or here in the forum I didn’t find the answer to my question:
What must I do to show my covers images if the gallery is empty?
For the gallery I have the following code:
<?php $gallery = $page->gallery()->toFiles(); foreach ($gallery as $image): ?> <?= $image->crop(165, 120) ?>
<?php endforeach ?>
and if the gallery is empty I want to show only my cover images:
<?php $images = $page->cover()->toFiles(); foreach($images as $image): ?>
<?php $image ?>
<?php endforeach ?>