Wordpress删除Google字体

Function代码

// Remove Open Sans that WP adds from frontend minirizhi.com
if (!function_exists('remove_wp_open_sans')) :
    function remove_wp_open_sans() {
        wp_deregister_style( 'open-sans' );
        wp_register_style( 'open-sans', false );
    }
    // 前台删除Google字体CSS
     add_action('wp_enqueue_scripts', 'remove_wp_open_sans');
    // 后台删除Google字体CSS
     add_action('admin_enqueue_scripts', 'remove_wp_open_sans');
endif;
文章目录