Comment counter display
-
Good morning, sir,
I would like to put the number of comments next to the nickname of the author of the comment. Before I had the code but after reinstalling the theme I lost the code and it doesn’t work anymore.
add_filter ('wpdiscuz_comment_author', 'my_commentCount', 10, 2); function my_commentCount ($ author_name, $ comment) { global $ wpdb; $ no_comment = "Aucun commentaire"; $ one_comment = "Un commentaire"; $ more_comments = "% commentaires"; $ count = $ wpdb-> get_var ('SELECT COUNT (comment_ID) FROM'. $ wpdb-> comments. 'WHERE comment_author_email = "'. addlashes ($ comment-> comment_author_email). '"'); $ comment_text = my_comment_number_text ($ no_comment, $ one_comment, $ more_comments, $ count); retourner $ nom_auteur. ' | <span class = "wpdiscuz-comment-count"> '. $ comment_text.' </span> '; } fonction my_comment_number_text ($ zero = false, $ one = false, $ more = false, $ number = 0) { if ($ number> 1) {$ output = str_replace ('%', number_format_i18n ($ number), $ more); } elseif ($ number == 0) {$ output = $ zero; } else {$ output = $ one; } return $ output; }Awaiting your return,
Yours sincerely,
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Comment counter display’ is closed to new replies.