• Hi

    Because I’ve already imported font awesome from my own theme, so I don’t want to import this CSS file from this plugin again, I use the following codes to remove it, but it was not working.

    /*Don’t import the fontawesome CSS from the woocommerce wishlist plugin*/
    if (function_exists( ‘yit_is_woocommerce_active’ ) ) {
    wp_deregister_style( ‘yith-wcwl-font-awesome’);
    wp_dequeue_style( ‘yith-wcwl-font-awesome’);
    }

    Is there any other hook I can use it?

    Thanks

    https://wordpress.org/plugins/yith-woocommerce-wishlist/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi ThemeVan,

    I had the same problem. I hunted down the register name which was in includes/class.yith-wcwl-init.php.

    Add this to your functions.php file and it will remove the Yith version:

    function dequeue_yith_font_awesome_css() {
      wp_dequeue_style('yith-wcwl-font-awesome');
      wp_deregister_style('yith-wcwl-font-awesome');
    }
    add_action('wp_enqueue_scripts','dequeue_yith_font_awesome_css', 100);

    Thanks so much for this crucialwarrior. I extended your snippet and added the following lines to remove even more of YITH’s CSS, as the border-radius on the “add to wishlist” button proved too difficult to override.

    function dequeue_yith_css() {
      wp_dequeue_style('yith-wcwl-main');
      wp_deregister_style('yith-wcwl-main');
      wp_dequeue_style('yith-wcwl-font-awesome');
      wp_deregister_style('yith-wcwl-font-awesome');
    }
    add_action('wp_enqueue_scripts','dequeue_yith_css', 100);

    Cheers man.

    Plugin Author YITHEMES

    (@yithemes)

    Hi guys,

    thank you for your effort to this forum, we really love our community 🙂

    Anyway, I should note that dequeuing wishlist main css may lead to unexpected style issue; I highly suggest to test this solution on a staging server, before switching to production 🙂

    Another solution may be overwriting default style, copying style.css from wp-content/plugins/yith-woocommerce-wishlist/assets/css and pasting it in wp-content/themes/<your_theme_root>/woocommerce, renaming it contextually to wishlist.css

    Now you can customize your brand new file as you wish, and our plugin will enqueue it, instead of its default css

    Hope this can help someone
    Have a nice day 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How can I remove font-awesome CSS?’ is closed to new replies.