Condition with ACF Field Value with "in" option

So, I started a thread at Condition with ACF Field Value that has a space. It was closed because I didn’t provide access to the site. (I’ve done that twice on this site, and support somehow blew away the entire page, so I’m really hesitant to give access.)

The original thread said:

I’m using a condition on a looper to show only particular content.

The condition is setup as:
{{dc:acf:post_field field=“topic”}} in Professional Development

The “topic” field is an ACF checkbox field with multiple options, some of which are single words (like “Teaching” and some of which are a phrase (like “Professional Development”.)

I have the ACF set to return the “Label” (because I’m displaying that label in various places).

When the condition is setup as:
{{dc:acf:post_field field=“topic”}} in Teaching
it works just fine.

I was originally thinking that the issue might have to do with the fact that the value had a space. However, I’ve subsequently realized that the Conditional only fails when I have more than one option selected in the “topic” field. That ACF field is setup as a “checkbox” type. Most of the records only have one checkbox checked. However, in this case, they have two … and my conditional returns nothing. Isn’t that the point of the “in” option?

How can I make this work?

Hey Danni,

Thanks for reaching out!

It would really be best if you could give us access to your website so that we can check on your setup properly. If you are hesitant to give your live website credentials, I highly suggest that you create a staging area.

Thank you.

I figured it out! I had to swap the two settings in the conditional.

So, instead of:
{{dc:acf:post_field field=“topic”}} in Professional Development

It has to be set as:
Professional Development in {{dc:acf:post_field field=“topic”}}

I have no idea why … and it seems to me like the system should either enforce that or be smart enough to figure it out. But for now, problem solved!

Hey Danni,

We’re glad that you’re able to figure it out.

Cheers!

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