2016-11-05 31 views

回答

1

wp_title已從版本4.4開始棄用。所以,我們應該使用新的過濾器pre_get_document_title。嘗試下面的代碼。

add_filter('pre_get_document_title', 'change_title'); 
function change_title($title) { 
    return 'My Custom Title'; 
} 

查看關於此掛鉤https://developer.wordpress.org/reference/hooks/pre_get_document_title/

+0

它的工作,非常感謝你:) –