Skip to content

Instantly share code, notes, and snippets.

@julian-stark
Last active April 14, 2023 09:05
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save julian-stark/e4d6bfc7a7b5d804255607da77e52553 to your computer and use it in GitHub Desktop.
Save julian-stark/e4d6bfc7a7b5d804255607da77e52553 to your computer and use it in GitHub Desktop.
This is a nicer method to replace Eicons from Elementor. Don't remove it in the backend - Elementor is based on it ;)
<?php
// Deactivate Eicons in Elementor
add_action( 'wp_enqueue_scripts', 'js_remove_default_stylesheet', 20 );
function js_remove_default_stylesheet() {
// Don't remove it in the backend
if ( is_admin() || current_user_can( 'manage_options' ) ) {
return;
}
wp_deregister_style( 'elementor-icons' );
}
@julian-stark
Copy link
Author

If you use Elementor Pro to build a header you might also need to use this CSS code for the hamburger icon: https://gist.github.com/julian-stark/08af8559a691b0b8b39bf7c509bcf1a7

@MatQV
Copy link

MatQV commented Jun 19, 2020

Sadly this is causing a critical error on my site :( I guess because Elementor has changed and this is old, any ways to do it with the most recent elementor?

Thanks man. @julian-stark

@Tragio
Copy link

Tragio commented Jul 29, 2020

Sadly this is causing a critical error on my site :( I guess because Elementor has changed and this is old, any ways to do it with the most recent elementor?

Thanks man. @julian-stark

❤️

// Deactivate Eicons at Elementor
add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 20 );
function remove_default_stylesheet() {
  
  // Don't remove it in the backend
  if ( is_admin() || current_user_can( 'manage_options' ) ) {
        return;
  }
	wp_deregister_style( 'elementor-icons' );
}

@julian-stark
Copy link
Author

Sadly this is causing a critical error on my site :( I guess because Elementor has changed and this is old, any ways to do it with the most recent elementor?
Thanks man. @julian-stark

❤️

// Deactivate Eicons at Elementor
add_action( 'wp_enqueue_scripts', 'remove_default_stylesheet', 20 );
function remove_default_stylesheet() {
  
  // Don't remove it in the backend
  if ( is_admin() || current_user_can( 'manage_options' ) ) {
        return;
  }
	wp_deregister_style( 'elementor-icons' );
}

I updated the snippet. Thanks!

@futurowebpl
Copy link

Hello guys,

I still have this in source code after turning off the eicons with this snippet.

<style id="elementor-frontend-inline-css"> @font-face{font-family:eicons;src:url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.eot?5.10.0);src:url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.eot?5.10.0#iefix) format("embedded-opentype"),url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.woff2?5.10.0) format("woff2"),url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.woff?5.10.0) format("woff"),url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.ttf?5.10.0) format("truetype"),url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.svg?5.10.0#eicon) format("svg");font-weight:400;font-style:normal} [class^="eicon"], [class*=" eicon-"] { font-family: "initial"; } [class^="eicon"]:before, [class*=" eicon-"]:before { content: ""; } </style>

@Tygovanommen
Copy link

Hello guys,

I still have this in source code after turning off the eicons with this snippet.

<style id="elementor-frontend-inline-css"> @font-face{font-family:eicons;src:url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.eot?5.10.0);src:url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.eot?5.10.0#iefix) format("embedded-opentype"),url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.woff2?5.10.0) format("woff2"),url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.woff?5.10.0) format("woff"),url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.ttf?5.10.0) format("truetype"),url(https://example.com/wp-content/plugins/elementor/assets/lib/eicons/fonts/eicons.svg?5.10.0#eicon) format("svg");font-weight:400;font-style:normal} [class^="eicon"], [class*=" eicon-"] { font-family: "initial"; } [class^="eicon"]:before, [class*=" eicon-"]:before { content: ""; } </style>

Same issue

@EXECdesign
Copy link

Still eicons.woff?5.10.0 (FCP/LCP) in Google Lighthouse test... (E 3.4.7 EP 3.5.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment