首先,修改語言包(wp-content\languages)就可以,但是語言包必須是編譯的,使用poedit進行編譯,將po編譯爲mo文件即可。
Updated on November 6, 2020 CST
方法一:修改 comments.php 文件
1)找到 functions 文件,如主題名稱爲 ‘aimeesign’,一般情況下,路徑如下
\wp-content\themes\aimeesign\comments.php
2)打開 comments.php,找到下面這句調用評論表單的代碼
<?php comment_form(); ?>
3)複製如下代碼,替換步驟 2) 的,保存完成。引號裏 ‘Leave your comment’ 爲修改後的標題
<?php comment_form(array(
'title_reply' => __( 'Leave your comment' ),
));?>
方法二:修改 functions.php 文件
1)找到 functions 文件,如主題名稱爲 ‘aimeesign’,一般情況下,路徑如下
\wp-content\themes\aimeesign\functions.php
2)複製粘貼如下代碼到 functions.php,保存完成。引號裏 ‘Leave your comment’ 爲修改後的標題
// Change comment title
function comment_reform ($arg) {
$arg['title_reply'] = __('Leave your comment');
return $arg;
}
add_filter('comment_form_defaults','comment_reform');