Okay
  Public Ticket #1767136
How to prevent loading Font Awesome CSS to avoid conflicts
Closed

Comments

  • GF started the conversation

    Hello,

    On my website I already had Font Awesome (5.4.2) implemented before installing the plugin.

    On the Events Page where the plugin is activated, the icons that are loaded by my own CSS for the website interface (Header and Footer) are broken, because of a conflict with the Font Awesome CSS loaded from the plugin.the 

    I can see that everything is working when I get rid of the stylesheet loaded from the plugin: "<link rel='stylesheet' id='stec-font-awesome-css' href='…wp-content/plugins/stachethemes_event_calendar/fonts/css/all.min.css?ver=4.9.8' type='text/css' media='all' />".

    I tried to deregister and dequeue it, but it doesn't work:

    wp_dequeue_style('stec-font-awesome-css');
    wp_deregister_style('stec-font-awesome-css');

    So, for the moment I am breaking the link by renaming "css/all.min.css?", which is just a very bad and of course temporary solution.

    I can't find the handle to deregister the CSS. Can you please point me in the right direction fir this to work?

    Or, do you see any other solution?

    What's the best way not to have conflicts between an already implemented "Font Awesome" and the one that the plugin try to inject and use?

    I am sure that this is something that most of the websites out there needs to sort out, as many use Font Awesome, right?

    I hope this will help others as well.

    Thanks in advance, 

    GF.

  •  799
    Zhivko replied

    Hi,

    In your theme functions.php file add following:

    add_action('wp_enqueue_scripts', function() {
        wp_deregister_style('stec-font-awesome');
        wp_dequeue_style('stec-font-awesome');
    }, 9999);



    Stachethemes Developer