大家都提到新版本的WordPress的后台访问速度非常慢,使用开发工具最后发现元凶是后台加入了Google字体的原因,由于Google被GFW的拦截导致WordPress一直加载Google导致后台访问速度奇慢!
解决方法也非常解决,我们只需要在当前主题的文件夹下编辑functions.php文件,加入一下代码即可完成对Google字体的禁用!
//禁用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;
» 禁用Google字体解决WordPress后台访问速度慢的问题
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。