![图片[1]-wordpress后台打开缓慢的临时解决方法 - StarFox Studio-StarFox Studio](http://starfox.cn/wp-content/uploads/2014/06/Snip20140619_4-1024x483.png)
最近打开博客后台,发现后台打开速度很慢。
通过开发者调试工具对网络加载进行检测,发现是由于后台使用了谷歌字体的API。由于谷歌api被墙的缘故,导致我们的浏览器会反复的请求谷歌服务器而无法正常加载页面。
因此简单的解决方案就是禁用谷歌的字体api。
解决方法是在当前主题的functions.php中加入下面的代码:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
//禁用Open Sans
classDisable_Google_Fonts{
publicfunction__construct(){
add_filter(‘gettext_with_context’,array($this,‘disable_open_sans’),888,4);
}
publicfunctiondisable_open_sans($translations,$text,$context,$domain){
if(‘Open Sans font: on or off’==$context&&‘on’==$text){
$translations=‘off’;
}
return$translations;
}
}
$disable_google_fonts=newDisable_Google_Fonts;
|
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END







想玩去皮/伊布
失效了大佬
暂无评论内容