On a university website, I use ACF to classify pages for degree programs. I have a shortcode that lets me filter by program type.
`’meta_query’ => array(`
`’relation’ => ‘AND’,`
`array(`
`’key’ => ‘filter_program_type’,`
`’value’ => $atts_args[‘type’],`
`’compare’ => ‘LIKE’`
`),`
`array(`
`’key’ => ‘filter_area_of_study’,`
`’value’ => $atts_args[‘subject’],`
`’compare’ => ‘LIKE’`
`),`
Using LIKE to compare, I get “Undergraduate Programs” when I am looking for the value “Graduate.” I understand this is expected behavior using LIKE, but when I change compare to = I get no results at all. Is there some other way to specify an exact match here?
Check your post_meta table to ensure your expected values are there with the expected keys.