I have this query that works fine:
$query = new WP_Query(array( 's' => $keyword ,'post_status' => array('publish', 'pending', 'draft')) );
Its searches and finds the post with the keyword in title.
I want to query posts with a few keywords at once, (Now i’m doing a loop over all keywords and query each keyword by itself.
If it was mysql it would have be something like:
Select * from ..... where title='keyword1' or title='keyword2' or title='keyword3' ;
How could achieve that with WP_Query?
You can’t do it using the
WP_Query
directly.An alternative for looping the
WP_Query
is use the$wpdb
.U have to use $wpdb (@codex)
I hope that help u:)