第二種方法:註釋或刪除掉style.css和function.php有關加載Google字體的代碼fonts.googleapis.com即可。
第三種方法:將以下代碼添加到主題目錄下的functions.php中
如果在更改style.css或function.php文件之後,wordpress網站報錯,無法打開,或者新建文章時上傳圖片失敗。壹定是將wordpress文件的編碼保存為非ANSI編碼,用記事本打開,保存時選擇編碼ANSI替換掉原來的文件即可。
class Disable_Google_Fonts {
public function __construct() {
add_filter( 'gettext_with_context', array( $this, 'disable_open_sans' ), 888, 4 );
}
public function disable_open_sans( $translations, $text, $context, $domain ) {
if ( 'Open Sans font: on or off' == $context && 'on' == $text ) {
$translations = 'off';
}
return $translations;
}
}
$disable_google_fonts = new Disable_Google_Fonts;
不會的可以來小小WP 看看 或者留言給我