Elementor有免费和专业版本,一般安装免费版本能满足大部分展示型的网站。将将下列代码加到主题的functions.php,即可禁止加载或者删掉谷歌字体。
1、禁止加载谷歌字体
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );
2、禁止加载Awesome字体
add_action( 'elementor/frontend/after_register_styles',function() {
foreach( [ 'solid', 'regular', 'brands' ] as $style ) {
wp_deregister_style( 'elementor-icons-fa-' . $style );
}
}, 20 );
foreach( [ 'solid', 'regular', 'brands' ] as $style ) {
wp_deregister_style( 'elementor-icons-fa-' . $style );
}
}, 20 );
3、禁止加载Eicons字体
add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 20 );
function remove_default_stylesheet() {
wp_deregister_style( 'elementor-icons' );
}
function remove_default_stylesheet() {
wp_deregister_style( 'elementor-icons' );
}
Elementor官方文档:https://docs.elementor.com/article/286-speed-up-a-slow-site