How many members have made comments approved for an article?
Your PHP is wrong but what you are doing looks like it should work. $count = $wpdb->get_var( ‘SELECT COUNT(distinct comment_author) FROM ‘ .$wpdb->comments. ‘ WHERE comment_approved = 1 AND comment_post_ID = ‘.$post->ID ); echo $count; Precisely, you were trying to use a variable inside single quotes, which doesn’t work. Variables don’t expand inside single quotes. … Read more