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