wordpress移除google字体(googleapis.com)
由于现在google在国内无法访问了,要能访问也是非常的慢的,我们wordpress中使用了google字体了,这样会影响到网站打开速度,所以直接去掉比较好,具体步骤如下.
google字体很强大,但是再强大也躲不过GFW.
不但很多主题在用google fonts,就连wp的后台本身也在用google fonts,所以呢,在墙内打开wp后台那个慢啊,实在忍无可忍,就把他去掉吧.
以下代码,直接加在functions.php的末尾即可,外观——编辑——选择模版函数functions.php,代码如下:
<?php function remove_open_sans_from_wp_core() { wp_deregister_style( 'open-sans' ); wp_register_style( 'open-sans' , false ); wp_enqueue_style( 'open-sans' , '' ); } //phpfensi.com add_action( 'init' , 'remove_open_sans_from_wp_core' ); ?>当然,还有一个简单的办法就是在你本地的host文件中加入下面配置,至少你本地不会卡.
127.0.0.1 fonts.googleapis.com
查看更多关于wordpress移除google字体(googleapis.com) - WordPress的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did8944