juggernautical on "[Plugin: YITH WooCommerce Wishlist] How can I remove font-awesome CSS?"

ساخت وبلاگ

ThemeVan
Member
Posted 2 months ago #

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/

crucialwarrior
Member
Posted 2 months ago #

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);

juggeautical
Member
Posted 1 minute ago #

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.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 271 تاريخ : پنجشنبه 30 ارديبهشت 1395 ساعت: 8:59