<span class="resolved" aria-label="Resolved" title="Topic is resolved."></span>D

[ad_1]

Replies: 1

Hello,

wordpress dequeue and deregister styles won’t apply for the front-end CSS files, where there’s no issue with other plugins/wordpress style sheets being removed.

Is there a reason why “ivole-frontend-css-css” can’t be removed on non-product pages, even with a 999 priority?

function dequeue_components_style_on_product_category_and_homepage() {
// Check if it’s a product category page, the homepage, or the front page
if (is_product_category() || is_home() || is_front_page()) {
wp_dequeue_style(‘ivole-frontend-css-css’);
wp_deregister_style(‘ivole-frontend-css-css’);
}
}

// Hook the function to the wp_print_styles action with a high priority
add_action(‘wp_print_styles’, ‘dequeue_components_style_on_product_category_and_homepage’, 999);

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer