Forked from JeffAspen/gist:eec107dce0313ea432e87c903480caa4
Last active
June 27, 2024 00:06
-
-
Save breakerh/f2406858f896d1e8682c9f49ab989c08 to your computer and use it in GitHub Desktop.
Elementor Remove Font Awesome; if you have inline icons experiment enabled you wont need to remove Font Awesome, * it will only load the icons that are used.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* https://docs.elementor.com/article/286-speed-up-a-slow-site | |
* | |
* Read me first: if you have inline icons experiment enabled you wont need to remove Font Awesome, | |
* it will only load the icons that are used. | |
* | |
* Note: By default, Font Awesome icons will only load on the pages where you've used them, so FA won't load on pages that aren't using any Font Awesome icons. | |
* This brings faster performance and faster page speed to your site, which can benefit your SEO and your users' experience. | |
* Only the CSS and fonts of the icon family you actually use are loaded. So only dequeue Font Awesome if you truly plan to not use any Font Awesome icons at all. | |
* If you dequeue Font Awesome, the icons will no longer show on any of your pages | |
* | |
*/ | |
add_action( 'elementor/frontend/after_register_styles',function() { | |
foreach( [ 'solid', 'regular', 'brands' ] as $style ) { | |
wp_deregister_style( 'elementor-icons-fa-' . $style ); | |
} | |
}, 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment