Display avatar with comment form?

I’ll answer myself. Add the following somewhere in functions.php or make it into a plugin: add_action( ‘comment_form_logged_in_after’, ‘psot_comment_form_avatar’ ); add_action( ‘comment_form_after_fields’, ‘psot_comment_form_avatar’ ); function psot_comment_form_avatar() { ?> <div class=”comment-avatar”> <?php $current_user = wp_get_current_user(); if ( ($current_user instanceof WP_User) ) { echo get_avatar( $current_user->user_email, 32 ); } ?> </div> <?php }

Let both the admin and post author update comment meta

You can try to replace if ($current_user->ID == $post_data->post_author) { with if ( $current_user->ID == $post_data->post_author || $current_user->has_cap( ‘manage_options’ ) ) { to additionally allow users, with the correct capability, to vote for the best comment.

Hide comments and posts posted by other user

You can use a filter to pre_get_posts so that only your posts are listed. Something like this: function my_posts_only( $query ) { global $pagenow; if ( ‘edit.php’ != $pagenow || ! $query->is_admin ) return $query; if ( ! current_user_can( ‘manage_options’ ) ) { global $user_ID; $query->set( ‘author’, $user_ID ); } return $query; } add_filter( ‘pre_get_posts’, … Read more

Disable comments and pingbacks on old custom post types

Let’s make it easier. I want to disable comments and pingbacks everywhere in all single posts, custom post types and pages both new and old. You could remove comment support for your post types. remove_post_type_support( ‘posttype’, ‘comments’ ); // for each of your post types of course The same can be done when registering the … Read more

Show comment pop up links as text only

For that matter, don’t use comments_popup_link(). Use comments_number() instead. This has the same function but not linked. <?php comments_number( ‘no responses’, ‘one response’, ‘% responses’ ); ?>

Disable only the comment form/box itself?

The comments_open() function is used, both by core and typically themes to determine status for specific post. It has filter of same name for result, which you can use to manipulate it individually for the post. comment_form() won’t actually output form if check is false and fire comment_form_comments_closed action in such case. Native WP themes, … Read more

Way to count the number of people who have commented on a post?

You could try to count the number of unique comment author emails per post: /** * Number of unique comment author emails per post: * * @see http://wordpress.stackexchange.com/a/168606/26350 * @param int $pid * @return int */ function get_unique_commenters_by_post_id( $post_id ) { global $wpdb; $sql = “SELECT COUNT(1) as uc FROM ( SELECT COUNT(1) as c … Read more