Revision: 52368
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 21, 2011 02:27 by florent
Initial Code
function author_comment_count(){ $oneText = '1'; $moreText = '%'; global $wpdb; $result = $wpdb->get_var(' SELECT COUNT(comment_ID) FROM '.$wpdb->comments.' WHERE comment_author_email = "'.get_comment_author_email().'"' ); if($result == 1): echo str_replace('%', $result, $oneText); elseif($result > 1): echo str_replace('%', $result, $moreText); endif; } To display an author’s total number of comments, use the function like this inside of your comments loop : author_comment_count();
Initial URL
Initial Description
Initial Title
Display the number of comments by author
Initial Tags
wordpress
Initial Language
PHP