分享我所知道的

woredpress去除加载谷歌字体

    前几天打开我网站的时候发现不管前台还是后台都很慢,后来才知道原来wordpress默认使用了谷歌字体服务,因为众所周知的原因,墙变硬了,把绝大部分的谷歌服务干掉了,只要在wordpress的主题文件中加一段代码屏蔽谷歌字体服务就可以了。
   在主题的functions.php文件夹加入下列代码即可实现

// 去除加载谷歌字体
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;

另外给两个能正常使用的谷歌搜索的ip

http://203.208.46.148/

http://203.208.36.19/

赞(0)
未经允许不得转载:追梦人博客 » woredpress去除加载谷歌字体
分享到:

评论 2

评论前必须登录!

 

  1. #0

    国人不自强啊,貌似360弄了个字体

    cxd4410年前 (2014-06-10)