display most active user sort by comment count [Solved]
you can use this $user = new wp_user(get_current_user_id()); function commentCount() { global $user; global $wpdb; $count = $wpdb->get_var(‘SELECT COUNT(comment_ID) FROM ‘ . $wpdb->comments. ‘ WHERE comment_author_email = “‘ . $user->data->user_email . ‘” and comment_approved = 1’); return $count; } echo ”; echo commentCount();