admin管理员组文章数量:1122832
I am using the same below code to dequeue many other styles but it is not working for Elementor, and a couple of others.
function enqueue_content(){
wp_dequeue_style( 'elementor-icons-shared-0' );
wp_dequeue_style( 'elementor-icons-fa-solid' );
wp_dequeue_style( 'elementor-icons-fa-regular' );
add_action('wp_enqueue_scripts', 'enqueue_content', 20);
I have also tried the method described on their support:
EDIT: It seems as if the styles I can't dequeue are loading from a different, parent wp-content folder (it is a multisite).
I am using the same below code to dequeue many other styles but it is not working for Elementor, and a couple of others.
function enqueue_content(){
wp_dequeue_style( 'elementor-icons-shared-0' );
wp_dequeue_style( 'elementor-icons-fa-solid' );
wp_dequeue_style( 'elementor-icons-fa-regular' );
add_action('wp_enqueue_scripts', 'enqueue_content', 20);
I have also tried the method described on their support: https://docs.elementor.com/article/286-speed-up-a-slow-site
EDIT: It seems as if the styles I can't dequeue are loading from a different, parent wp-content folder (it is a multisite).
Share Improve this question edited May 19, 2020 at 9:37 flinch85 asked May 19, 2020 at 8:50 flinch85flinch85 1012 bronze badges 2- 1 Have you tried increasing '20' to something like '100'? Also, consider installing the Debug Bar plugin(s) developer.wordpress.org/plugins/developer-tools/… They may be able to show you what priority the enqueue styles currently have. – Ted Stresen-Reuter Commented May 19, 2020 at 9:00
- I have tried increasing the number. Unfortunately it's a site where I have no access to plugins. Have just realised it's a multisite and loading from two different wp-content folders. Edited question. – flinch85 Commented May 19, 2020 at 9:13
1 Answer
Reset to default 0I ran into the same issue. This snippet worked for me.
add_action('elementor/frontend/after_register_styles',function() {
foreach( [ 'solid', 'regular', 'brands' ] as $style ) {
wp_deregister_style( 'elementor-icons-fa-' . $style );
}
}, 20 );
You may only need the solid and regular dequeued.
add_action('elementor/frontend/after_register_styles',function() {
foreach( [ 'solid', 'regular' ] as $style ) {
wp_deregister_style( 'elementor-icons-fa-' . $style );
}
}, 20 );
Elementor Reference
本文标签: phpCannot dequeue Elementor Font Awesome css
版权声明:本文标题:php - Cannot dequeue Elementor Font Awesome css 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283675a1927045.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论