<?php
global $wpdb;
$where = 'WHERE comment_approved = 1';
$comment_counts = (array) $wpdb->get_results("
SELECT COUNT( * ) AS total
FROM {$wpdb->comments}
{$where}
", object);
echo $comment_counts[0]->total;
?>
cat /var/log/life.log | grep -E "life|work|etc"
<?php
global $wpdb;
$where = 'WHERE comment_approved = 1';
$comment_counts = (array) $wpdb->get_results("
SELECT COUNT( * ) AS total
FROM {$wpdb->comments}
{$where}
", object);
echo $comment_counts[0]->total;
?>
24 responses
Do you want to comment?
Comments RSS and TrackBack Identifier URI ?
Trackbacks