Articles of comments

How to change commenter links to /user/user_id?

I would like to change the commenter links as shown in this screenshot: In my test plugin at GitHub I have first tried the following code: define(‘PROFILE’, ‘<a href=”/user/%s” rel=”external nofollow” class=”url”>%s</a>’); function get_comment_author_link($cid) { $uid = get_comment_author($cid); return sprintf(PROFILE, $uid->ID, $uid->name); } add_action(‘get_comment_author_link’, ‘get_comment_author_link’); But then by studying the file wp-includes/comment-template.php I have realized, […]

Comments Pagination as an unordered list

I am currently using <?php paginate_comments_links(); ?> to display comments pagination. How can I customise this so that it uses a UL and LI? (Such as is possible with custom post pagination). Thanks

Hide default “Recent Comments” Widget if there are no comments yet

Is there a way to hide the widget completely if there are no comments yet? I was thinking about maybe adding a php function to my functions.php file – is that a possible way? If so, can someone provide a suggestion?

How to add a privacy-checkbox in comment-template?

i need to add a privacy-checkbox to the file comment-template.php. I created the checkbox and a paragraph and it looks fine, so far. <input type=”checkbox” name=”privacy” value=”privacy-key” class=”privacyBox” aria-req=”true”><p class=”pprivacy”>Hiermit akzeptiere ich die <a target=”blank” href=”″>Datenschutzbedingungen</a><p> Now, i want to connect this checkbox with the submit-button, so that a user HAS to accept the privacy […]

Count all comments of a custom post type

I know how to count comment per post, user and in total but i am having problems getting the total amount of comments post in a specific post type. I guess i can loop trough all the posts and count each one comments but i am looking for something faster and less resource expensive Appreciate […]

WordPress comments email notification for authors

I’m admin of a question and answers website in WordPress. All users are defined like authors. I have the problem that when I approve a comment ( an answer to a question), the author receives too much personal information ( email address, ip, whois arin, links of: spam it, trash it, approve it, ) of […]

Can wp_list_comments output into variable?

Is there any way how to output wp_list_comments() into a variable? Something like $output = wp_list_comments(array(‘reverse_top_level’ => false ), $comments); I am writing a plugin and it would be handy to use standard WordPress function instead of writing my own.

custom comments on specific post type

I have a custom post type called debate and I want to create some custom fields just on this post type. So, I have this code: function debate_comment_fields( $fields ) { if( is_singular( ‘debate’ ) ) { unset($fields[‘url’]); unset($fields[‘author’]); unset($fields[’email’]); $fields[‘options’] = ‘<p class=”comment-form-options”><label for=”options”>’ . __( ‘I want to’ ) . ‘</label>’ . ‘<input […]

How do we remove the H3 tag for the reply-title I.D

We’re doing some SEO tweaking to a site, and our SEO guru informs us that we need to remove the <h3> tags from the #reply-title element, output from line 1554 of comments-template.php. It’s the header text for the comments form. as seen here : <?php if ( comments_open( $post_id ) ) : ?> <?php do_action( […]

Removing <li> from Comment

I’m making a custom comment template, and I do not wish to use a list to display comments. By default, WordPress puts the following at the end of every comment: </li><!– #comment-## –> I know I could hack the core wp-includes/comment-template.php, but that would leave me to not be able to update normally. Is there […]