PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > CMS教程 > wordpress教程 > 正文

    谷歌打不开,wordpress3.9如何禁止加载谷歌字体

    作者:w634381967来源:网络浏览:时间:2020-09-30 00:07:50我要评论
    导读:网站半个多月没有怎么管理,今天进来一看,加载速度非常慢,检查了一下才发现加载了谷歌字体。我记得3.8是没加载谷歌字体的,大家都知道上...
    网站半个多月没有怎么管理,今天进来一看,加载速度非常慢,检查了一下才发现加载了谷歌字体。

    我记得3.8是没加载谷歌字体的,大家都知道上月低谷歌被封杀了。。。所以现在加载谷歌字体的话,网站打开速度会非常慢

    个人判定这应该是升级到3.9后自动加载的..

    解决方法如下(下面代码添加至function.php):

    function remove_open_sans() {
    wp_deregister_style( 'open-sans' );
    wp_register_style( 'open-sans', false );
    wp_enqueue_style('open-sans','');
    }
    add_action( 'init', 'remove_open_sans' );

    另外给出去除wp_head中无用信息的代码,这样就不会现在网页head里面显示wordpress版本号、feed等地址了

    // 去除wp_head()中没用的标签
    remove_action( 'wp_head', 'wlwmanifest_link' );
    remove_action( 'wp_head', 'index_rel_link' );
    remove_action( 'wp_head', 'feed_links', 2 );
    remove_action( 'wp_head', 'feed_links_extra', 3 );
    remove_action( 'wp_head', 'rsd_link' );
    remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
    remove_action( 'wp_head', 'wp_shortlink_wp_head',10,0 );
    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-103-1096-1.html
    相关热词搜索: