Yazar sayfasına ekleyin

global $wpdb;
$user_id = $post->post_author; //change this if not in a std post loop
$where = 'WHERE comment_approved = 1 AND user_id = ' . $user_id ;
$comment_count = $wpdb->get_var(
"SELECT COUNT( * ) AS total
FROM {$wpdb->comments}
{$where}
");
$user = get_userdata($user_id);
$post_count = get_usernumposts($user->ID);
echo '

User ' . $user->display_name . ' post count is ' . $post_count .', comment count is ' . $comment_count . '

';
?>