I want to use this code snippet to limit the count to users of the blog. That is; exclude the administrator from the count. Any ideas?
‘<?php
$numcomms = $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = ‘1’”);
if (0 < $numcomms) $numcomms = number_format($numcomms);
?>’
Thanks in advance.
The topic ‘Total number of comments excluding admin’ is closed to new replies.
(@tsalagi)
14 years, 2 months ago
I want to use this code snippet to limit the count to users of the blog. That is; exclude the administrator from the count. Any ideas?
‘<?php
$numcomms = $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = ‘1’”);
if (0 < $numcomms) $numcomms = number_format($numcomms);
?>’
Thanks in advance.