I have a custom field in my posts called “position” , Actually i created it with ACF checkboxes and it returns an array.Now i wanna query posts filtered by this custom field in this way that if value “x” is in the custom field then show the post. I tried this code but it doesn’t work 🙁
$posts_sabet_1 = new WP_Query(
array(
'post_type' => 'sabet',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'position', // array
'value' => 'top', // is "top" in "position" field?
'compare' => 'LIKE' // I also tried "IN" , "=" , "RLIKE" . none of them worked
)
)
)
);
Did you try something like this ?