display only parent replies count in index.php

Based on this answer I suggest the following code: // the theme’s functions.php /** * Get the number of top level comments for a post. * * @param int $post_id * @return int */ function wpse_95242_top_level_comments_for_post( $post_id = NULL ) { if ( NULL === $post_id ) $post_id = get_the_ID(); if ( ! $post_id ) … Read more

Comment moderation with disqus comments

Disqus pre-moderation rules are set on http://disqus.com/admin/settings/ and can’t be administered via WordPress. Currently there are only options to pre-moderate all comments, or comments from unverified users globally. If you wanted this kind of granularity, you can always register a new Disqus shortname (which is a container for all of your comments/settings) and install the … Read more

Comment Blacklist

I just did a quick test and the comment blacklist appears to be ignored for logged in administrators (possibly other roles). It does effectively block comments when logged in as a subscriber. I suspect that that is the behavior you are seeing.

Can I use WP comments for custom tables?

You could create a hidden dummy post and use always its post ID as comment_post_ID. Then use a comment meta field to store the related ID from your custom table. The other, and probably better option: use custom post types, not tables if you need something that acts like a post. Register that post type … Read more

Identify and display the fact that user is admin next to username in comment section

From inside a comment Loop… $author_data = get_user_by(‘login’,$comment->comment_author); if (!empty($author_data)) { var_dump($author_data->roles); } $author_data->roles is an array so you will need to work out what you want to do with that. That is, print them all? Print the highest ranking role? if (array_intersect(array(‘administrator’,’moderator’),$author_data->roles)) { echo ‘admin’; } elseif (array_intersect(array(‘something’,’else’),$author_data->roles)) { echo ‘something else’; }

delete user not working

WordPress should give this option below Attribute all posts to: Anyhow, I wrote a post on this (Clean Comments Table After User Deleted) Edit Also, you can move your all posts from deleted users to admin user. global $wpdb; $admin_id = 1; // Assign admin user id here $posts_table = $wpdb->prefix . ‘posts’; $users_table = … Read more

I want to fill the comment with the comment count?

I think the reason for your header already sent error is that you are using comments_number() that will echo the value. Try instead get_comments_number( $post_id ); to return it. The Codex info on this function says that it returns the total number of comments, trackbacks, and pingbacks for the post.