relace this: with this: get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1';"); } $number = $comment_count_cache[$id]; if (($number != 0) || !('closed' == $post->comment_status)) { comments_popup_link('No Comments', '1 Comment', '% Comments', 'comments-link',''); } ?>