I have a question about the comment numbers in a post... For now, I can output the total number of a comment inside a post outside the loop. That's cool enough, but I want to get show the comment number/amount of a post PER DAY. So let's say I have a post and people are commenting 10 times today... Than, I want to show ' 10 comments' after the post title... If the day goes by and just 1 person comments the next day, I want it to output '1 comment' after the post title...
Is this possible, if yes, how?
I want to use the following function to output this "comment today per post after each post":
function wowPosts($num) {
global $wpdb;
$posts = $wpdb->get_results("SELECT comment_count, ID, post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , $num");
foreach ($posts as $post) {
setup_postdata($post);
$id = $post->ID;
$title = $post->post_title;
$count = $post->comment_count;
$comment_count = get_comment_count($post->ID);
$all_comments = get_comment_count( array ( 'post_id' => get_the_ID() ) );
if ($count != 0) {
$popular .= '<li>';
$popular .= '<a href="' . get_permalink($id) . '" title="' . $title . '">' . $title . '</a> '. count( $all_comments ) . ' ';
$popular .= '</li>';
}
}
return $popular;
}