May I query posts by taxonomy field as one would do for a checkbox field, for example?
I don’t wish to activated Load or Save terms in the taxonomy field (as I don’t need the extra classes created by post_class function) and was trying to query the posts with meta_query and not tax_query. Possible?
I haven’t been to get it working.
My code:
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'project-fields',
'value' => 'architecture',
'compare' => 'LIKE',
),
array(
'key' => 'project-fields',
'value' => 'research',
'compare' => 'LIKE',
),
),
Thanks.
If you are not saving and loading terms then you must use a meta_query. But, ACF stores the term ID of each term selected, not the term name. And you’re like value needs to look something like '"'.$term_id.'"'
because ACF stores a serialized array for the selected terms.