Hi. I came across with such difficulty. I am trying to search by custom field, for example color. I am using GetPostsQuery class. I want to use “like” operator –
$args['meta_key'] = 'color' $args['meta_value']['like'] = 'blue'
But here like operator works as equal operator. I want to find out why.
I want this query to bring not only blue colors, but also light-blue.
Also if my field is multi-select, I have to write
$args['meta_value'] = '["blue", "red"]'
to get the result I want. But there must be another way, or maybe I am doing something wrong. Please help me with this.
I am using clean wordpress on the default theme, with no other plugins installed.
- The topic ‘GetPostsQuery operator like’ is closed to new replies.