/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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): elseif($result > 1): endif; } To display an author’s total number of comments, use the function like this inside of your comments loop : author_comment_count();
Comments
