Conditions: How to add a combination ACF selections

Hi there,

I’m trying to show/hide content based on the condition that a specific ACF (field type: select) meta key has two specific values.
Unfortunately I can only get it to work with one value. As soon as two values are selected it doesn’t work anymore.

So this works If only one option is selected:
{{dc:post:meta key=“selection”}} is Option1

This doesn’t work:
{{dc:post:meta key=“selection”}} is Option1 and
{{dc:post:meta key=“selection”}} is Option2

How can I achieve that?
Thanks

Hello @ArtOfSpring,

Thanks for writing in! You will have to use the OR logic.

{{dc:post:meta key=“selection”}} is Option1 OR
{{dc:post:meta key=“selection”}} is Option2

When adding your second condition, DO NOT click the “AND”.

You must click the “Add Condition Group” so that you will have this:

Kindly let us know how it goes.

Hi there,

I’m sorry I need to clearify. The meta key is the same for both options. So the ACF selection allows multiple values. And I want to show/hide content if two values of this one selection field are chosen.

So let’s say the ACF selection has option 1, option 2 and option 3. If option 1 and option 3 are selected I want the content to be displayed using conditions.

Hello @ArtOfSpring,

The “OR” logic may be definitely the one you need. Let me demonstration these conditions:

If ACF selection is Option 1 AND ACF selection is Option 3, both needs to be TRUE to be able to use this condition.

If ACF selection is Option 1 OR ACF selection is Option 2, only one needs to be TRUE to be able to use this condition. If you both are selected, it is still true.

If you have strict rule condition that MUST be followed then the “AND” logic can be used in your layout.

Best Regards.

That is exactly what’s not working as intended.
I’ve set up an example: https://www.art-of-spring.marketing/posts/

There should be a headline element next to the post if the conditions are met.
(“This is visable if option 1 & option 3 is selected in the ACF selection.”)
Conditional element
Conditions

Hello @ArtOfSpring,

This is your Selection field:

And the return values will be separated in commas, therefore your condition will be like this:

Hope this helps.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.