嗨,我想在作者页面中显示作者评论数。此代码可以显示当前用户评论计数,但我不想要当前用户我需要任何用户请帮助我
/* user commnet count */
function commentCount() {
global $wpdb, $current_user;
get_currentuserinfo();
$userId = $current_user->ID;
$count = $wpdb->get_var(\'
SELECT COUNT(comment_ID)
FROM \' . $wpdb->comments. \'
WHERE user_id = "\' . $userId . \'"\');
echo \'Şərh sayı \' . $count ;
}
<?php commentCount(); ?>