how to wp_query – meta_query value string contain in key string ?
-
Hello..
I’m making theme and i need to echo cuustom post type.
I’m making query that will use meta_query.in my database ther’s a field called ‘dog’ it’s string value, but that string is something like: “text, some other text, the third text, ” atc.
so.. the problem is that i want my query to search throught all string in DB and if value is in string then show that post..
for expample the value well be :’some other text’..
so if ‘some other text’ contains in “text, some other text, the third text, ” atc. then echo post.
my code is:$email_query = new WP_Query (array ( 'post_type' => $field_of, 'post_per_page' => -1, 'meta_query' => array( array( 'key' => $select_of, 'value' => $select_val, 'compare' => 'IN' ) ) ));I’v tied all COMPARE values that have been writen in WP_QUERY documentation. works with “<=” but if i enter some value that not in that string it steels echo’es all posts..
Help please! what “compare” should be ?
may be ther’s a chance making my own “compare” ??
The topic ‘how to wp_query – meta_query value string contain in key string ?’ is closed to new replies.