We have a loop with an ACF radio field, let’s call them option_one, option_two, option_three and option_four.
I need to filter a loop for any post that has either option_one or option_three selected.
If I enter both values there is no output, I’m assuming because it’s looking for both values in the field (although that does work for multiple post types).
You’re close. On its own, field_value does an exact match, so option_one,option_three is compared as a single string and nothing matches. Add field_compare=in and the value is read as a comma-separated list. A post matches if its field is any one of them:
<Loop type=custom_post field=custom_field field_value=option_one,option_three field_compare=in count=2>
<Field title />
</Loop>
count=2 is applied after the filter, so you get the first two posts that have either option rather than two posts that are then filtered.
field_compare accepts the same operators as the If tag (is, is_not, in, not_in, exists and so on). They’re listed under Comparisons on the If tag page: If | Loops & Logic. The Loop page mentions field_compare but doesn’t spell out the values, which is why it’s hard to find. I’ve flagged that as a docs gap.
If the post type is large, there’s also a database-side version that filters inside the query instead of after it:
<Loop type=custom_post custom_field=custom_field custom_field_value=option_one,option_three custom_field_compare=in count=2>
<Field title />
</Loop>
Same result. One caveat on the current version (4.3.2): it logs a PHP warning (“Undefined variable $value”) each time it runs. The query itself is fine, but the warning shows on the page if WP_DEBUG display is on. That’s a bug on our side and I’ve flagged it for a fix.