WordPress移除Google字体方法

作者:30115776@qq.com

国内访问WordPress网站的时候,会发现里面引用Google字体会导致加载速度变得很慢,这时候需要移除Google字体,今天为大家分享一下WordPress移除Google字体方法。

在 function.php 中添加如下代码:

if (!function_exists(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’remove_wp_open_sans\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’)){

function remove_wp_open_sans() {

wp_deregister_style( \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’open-sans\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ );

wp_register_style( \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’open-sans\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’, false );

}

add_action(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’wp_enqueue_scripts\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’, \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’remove_wp_open_sans\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’);

}

发表评论