確定我已經計算出來。如果您沒有子主題,則需要將代碼發佈到functions.php文件中。建議您設置一個,但我還沒有,我只是想先弄清楚這個問題。以下是您需要的快照。
文字的下面的框添加到底部或您的自定義的functions.php或頁面functions.php的外觀之內>編輯
add_filter('get_comment_author', 'my_comment_author', 10, 1);
function my_comment_author($author = '') {
// Get the comment ID from WP_Query
$comment = get_comment($comment_ID);
if (!empty($comment->comment_author)) {
if($comment->user_id > 0){
$user=get_userdata($comment->user_id);
$author=$user->first_name.' '.substr($user->last_name,0,1).'.'; // this is the actual line you want to change
} else {
$author = __('Anonymous');
}
} else {
$author = $comment->comment_author;
}
return $author;
}
確保更新用戶信息。
Missing Sections from the Original Question