時(shí)間:2022-07-30 11:54:01 | 來源:建站知識(shí)
時(shí)間:2022-07-30 11:54:01 來源:建站知識(shí)
由于之前發(fā)過一篇wordpress禁用谷歌字體的方法,該方法是用安裝插件!
由于后臺(tái)插件越多導(dǎo)致網(wǎng)站打開速度慢,那么我們能不用插件就盡量別用.
本篇文章黃坤教大家如何不用插件去解決谷歌字體打開緩慢的問題.
1.首先我們找到你的站點(diǎn)主題的functions.php文件,在wp-content/themes/你的主題名稱/的文件夾里面
2.打開functions.php ,我們會(huì)看到首頁第一行的
3.我們只要在首頁第一行代碼
//禁用Open Sans
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;
如圖:
即可解決wordpress谷歌字體問題!
本篇文章由黃坤的站長(zhǎng)博客編輯 原文轉(zhuǎn)載請(qǐng)注明出處:
關(guān)鍵詞:字體,方法,解決
客戶&案例
營(yíng)銷資訊
關(guān)于我們
客戶&案例
營(yíng)銷資訊
關(guān)于我們
微信公眾號(hào)
版權(quán)所有? 億企邦 1997-2022 保留一切法律許可權(quán)利。