记解决Google font导致WordPress访问变慢问题

Way 1:Install(安装)  Remove Google Fonts References

Way 2:Add some code in function.php(添加代码进入function.php)

// PHP CODE

<?php
/*
Plugin Name: DW Replace Open Sans
Plugin URI: http://devework.com/replace-open-sans.html
Description: 将WordPress 后台中的open-sans字体加载源从Google Fonts替换为360CDN加载源。
Author: Jeff
Author URI: http://devework.com/
Version: 1.0
@Thanks: https://gist.github.com/MikeNGarrett/8462474#
*/
function devework_replace_open_sans() {
wp_deregister_style('open-sans');
wp_register_style( 'open-sans', '//fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600' );
wp_enqueue_style( 'open-sans');
}
//前台加载,看需要注释之;
add_action( 'wp_enqueue_scripts', 'devework_replace_open_sans' );
//后台加载,应该都需要的了
add_action('admin_enqueue_scripts', 'devework_replace_open_sans');
?>

加入讨论

电子邮件地址不会被公开。