[已解決] 修改 “Leave a Reply” – WordPress 評論標題

首先,修改語言包(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');
Static Image

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章