确定我已经计算出来。如果您没有子主题,则需要将代码发布到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