Logic operator "or"

Hello,

Could you help me on this following syntax please ?
I need to make “or” comparison, but I can’t find the correct way in the documentations and i’m really not sure about this one…
Many thanks.

<If type=acf_image includes="caption || description" post=current>

This post help me to find something, but it doesn’t work… !

<If type=acf_image includes="caption, description" post=current>

Hey @af1ne, your issue here seems to be that you’re freestyling the syntax! Just like in HTML, every tag in L&L has its own syntax and you can’t go mixing and matching attributes between different tags, it’ll never work. For example, post=current isn’t accepted by the If tag (you seem to have borrowed that from the Loop tag) and type=acf_image simply doesn’t exist anywhere in the language. Kudos for looking through the forum though, that’s often a great way to get solutions to your issues!

Step one here is to think about what you’re actually trying to do. Based on your template, I assume you want to check if a custom ACF image field (which you haven’t actually referred to in your template; what’s the field name you’re trying to work with?) includes any kind of value in either its standard description field or some custom caption field that you’ve defined yourself on all the items in your media library. Is that correct?

In any case, you’ll probably want to familiarise yourself with the correct syntax of the If tag, how to loop through the fields of an attachment associated with an ACF image field, as well as the fields available on an attachment (an ACF image field contains a relationship to an attachment post, i.e. an item in your media library).

I hope that points you in the right direction!