电影中心 精品软件 联系我们

 找回密码
 立即注册

QQ登录

只需一步,快速开始

Close
查看: 426|回复: 0

禁用wordpress后台google字体

[复制链接]
发表于 2014-6-6 23:08:31 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×

众所周知的原因,google这次挂的很彻底,chrome、gmail、翻译等全线google服务都受到很大影响。

2012-04-01%2010.39.172%20-%20_medium.jpg

wordpress因为使用了Google Fonts字体,后台打开需要加载数十秒,无法忍受的慢,只好干掉这项服务了。

2014-06-04_191654.jpg

方法一:

后台搜索Disable Google Fonts插件安装。

3 \7 J4 c  f* y' G

方法二:

主题的functions.php添加以下代码

//禁用Open Sans
0 ]8 i1 R+ D. JclassDisable_Google_Fonts{
) }$ V  D8 l5 S3 r. C6 b        publicfunction__construct(){( g* E% U. W5 F" o
                add_filter('gettext_with_context',array($this,'disable_open_sans'             ),888,4);% {! i) d9 j1 P& T
        }
4 q9 i0 b+ L9 s. ?        publicfunctiondisable_open_sans($translations,$text,$context,$domain){* V4 O$ |3 l7 ]- Z3 X
                if('Open Sans font: on or off'==$context&&'on'==$text){5 T, x! P0 [! c/ b0 X. x
                        $translations='off';4 o  ?& [: q5 y- r$ W
                }9 d0 A! i  r0 m, O. }+ Z* I
                return$translations;9 K3 T2 Z: D& W9 S% T" \: M4 G
        }) h$ ?0 G9 P5 r) X+ z7 P
}
0 H  D% Q3 @. h7 j& a' U' U7 K" E. y$disable_google_fonts=newDisable_Google_Fonts;
6 r8 R; T6 V8 x5 M( z& x' D

: w$ l5 q+ ?1 E3 ^+ m
/ N- S- D2 W5 y& ?* f4 f- Vup:写完这篇文章,发现数字做了镜像的字体加速CDN,刚刚更换测试了下,也可解决上述问题,需要的朋友可以试试。
  V5 n& v- {8 s, S
. B9 l4 V4 F1 e6 o3 I! w6 T2 F
$ h3 [- n8 ]* b! P0 P 9ac38936jw1eh2cddr05fj20c81gen6v.jpg
) b! K6 F6 b/ z4 {
5 W) ~9 j- N3 x" |
3 C1 m/ K6 a: g: ?最后,我想再骂一次:尼玛的!
3 [7 q0 X+ Z; y$ P
, L% e) y; j0 a
" c+ ?4 ^0 K( n9 x# n
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|帮助|古城IT技术联盟 ( 鲁ICP备06030014号 )

GMT+8, 2024-4-27 09:03 , Processed in 0.107386 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表