马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
众所周知的原因,google这次挂的很彻底,chrome、gmail、翻译等全线google服务都受到很大影响。
wordpress因为使用了Google Fonts字体,后台打开需要加载数十秒,无法忍受的慢,只好干掉这项服务了。
方法一: 后台搜索Disable Google Fonts插件安装。
# h9 q7 l2 K6 @6 Q, V方法二: 主题的functions.php添加以下代码 //禁用Open Sans
, v* G% B; ^/ R, Y1 t8 a$ _classDisable_Google_Fonts{
3 M& E/ \" q: f publicfunction__construct(){1 k% V# M1 w* T C
add_filter('gettext_with_context',array($this,'disable_open_sans' ),888,4);4 a0 D( x) H- u3 s# W# G) t
}
: i2 I1 g1 X) t/ g a+ V) w( Q publicfunctiondisable_open_sans($translations,$text,$context,$domain){
- b/ N! b) _+ ^9 f( j. g: x if('Open Sans font: on or off'==$context&&'on'==$text){
) p3 J: f( |2 ^4 x' J+ M3 Z $translations='off';
& L8 z% E0 F9 ]* ]2 L3 m) q }
9 r, y) Q# k: I8 f3 t- X3 n return$translations;
, T5 n2 s0 k0 ~1 S9 C: p. e9 S }
: }( ~4 ]" F2 c0 p: b/ t% z}* j. G3 h( X, `/ O [1 s) C
$disable_google_fonts=newDisable_Google_Fonts;* y. {, P& I l$ K7 Z
- j: p0 l8 i1 l; Z3 H' g( j7 t
* ?; @! C: ]( n; W2 i, E* `
up:写完这篇文章,发现数字做了镜像的字体加速CDN,刚刚更换测试了下,也可解决上述问题,需要的朋友可以试试。4 a5 X' T0 M6 d, Z6 R1 e( p
! U% c. B8 I5 j+ A! J
$ c, W Q8 {4 Q0 |0 @ d
1 o* }( M0 F' C7 ?! C8 s) x
" u+ X1 D% b: S ? N
+ F& G/ l% Y9 @2 g1 {* d% P
最后,我想再骂一次:尼玛的!6 o9 M8 j2 [- o* v" j
5 P. @& U! R1 H9 m; L1 ?8 E# _
, q1 d' @+ N6 R5 k" F |