Does anyone have an idea of how to get posts that have no comments yet and have specific tags?
I tried
$args = array(
'tag' => $tags,
'post__not_in' => array($page_id),
'showposts'=>5,
'ignore_sticky_posts'=>1,
'comment_count' => 0
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
... the usual stuff here ...
endwhile;
}
but this gives me also the posts that were already commented even if there’s a “‘comment_count’ => 0” argument! Why? What’s the right solution?
Thanks.
I figured out that after using
Wp_Query()you get an object that holds your query … so if you copy paste it into your php code and add awp_posts.comment_count=0condition in the WHERE clause it works perfectly!