It took some debugging but i found a solution for your problem. You can add a little bit of custom CSS to your page settings, this will hide the fancybox images which don’t have an image.
@edwine1987 Thank you so much. This is really good.
Ideally, I would like the now “empty” slides (without the “image not found” message) not to appear. This would mean that you would navigate from the last image to the first one.
That won’t be possible with CSS, we need some JavaScript for this, first we need to remove all the elements that have no image, after that you can call the Fancybox.bind function
Place the following JavaScript just above Fancybox.bind…
function removeInvisibleElements() {
const elements = document.querySelectorAll('.w-condition-invisible');
elements.forEach(element => element.remove());
}
removeInvisibleElements();