Hi!
I would like to get posts by keyword using query_posts.
So, how can I query posts, that contain "big dog" as content?
Thanks.
Hi!
I would like to get posts by keyword using query_posts.
So, how can I query posts, that contain "big dog" as content?
Thanks.
Use a filter to add a WHERE condition:
function mam_posts_where ($where) {
global $mam_global_where;
if ($mam_global_where) $where .= " $mam_global_where";
return $where;
}
add_filter('posts_where','mam_posts_where');
$mam_global_where = " AND $wpdb->posts.post_content LIKE '%big dog%'";
query_posts(your args here);
$mam_global_where = ''; // Turn the filter off!This topic has been closed to new replies.