How to hide modal toggle button with conditonal statement if the gallery is empty?

In my ACF posts I have added a gallery with a modal. This works fine. But in some posts I don´t have any images in the gallery.Then I would like to hide the whole gallery and the trigger button. I have tried to use Conditions (screen shot) for the whole DIV where I’ve put the gallery, but the trigger button refuses to disappear. I have also tried the same conditional statement

Skärmavbild 2026-05-06 kl. 18.14.23

How to solve this?

Best Regards
Bengt

Hey Bengt,

Thanks for posting in! Since you have used it as in your Looper Provider, you can use:

Provider Output IS NOT Empty

image

If this does not work, we would be happy to double check your site if we can log in. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Hi @ruenel

As usual, your advice worked. I’, very greatful for your excellent support .

Best regards
Bengt

You are most welcome, Bengt.