最近打开博客后台,发现后台打开速度很慢。
通过开发者调试工具对网络加载进行检测,发现是由于后台使用了谷歌字体的API。由于谷歌api被墙的缘故,导致我们的浏览器会反复的请求谷歌服务器而无法正常加载页面。
因此简单的解决方案就是禁用谷歌的字体api。
解决方法是添加下面的主题在目前的代码在functions.php:
PHP Code复制内容到剪贴板 //禁用OpenSans 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('OpenSansfont:onoroff'==$context&&'on'==$text){ $translations='off'; } return$translations; } } $disable_google_fonts=newDisable_Google_Fonts;
【wordpress后台打开缓慢的解决方法(临时)】相关文章:
★ 如何在wordpress上增加文件上传的大小限制(多种实现方法)
★ wordpress在IIS下伪静态后子目录无法访问的解决方法