0

/vendors/font-awesome/font-awesome.min.css? ver=2.9.10

/yith-woocommerce-wishlist/assets/css/font-awesome.min.css? ver=4.7.0

/theme/css/font-awesome.min.css

**this csss are from different plugins and main theme.

and error is :

The following resources have identical contents, but are served from different URLs. Serve these resources from a consistent URL to save 2 request(s) and 60.5KiB.**

how can i combine them as one?

autoptimize wp plugin is not compatible with my website.

https://www.tarhdokan.com/

1 Answer 1

2

You can use wp_dequeue_style() to remove CSS a plugin is adding.

You can use it to dequeue the 2 stylesheets coming from your plugin and just keep the one in your theme.

However, they appear to be different versions of Font Awesome so you may run into some issues there, I'm not sure I don't use Font Awesome.

Here is an example of wp_dequeue_style() which you can edit and add to your theme's functions.php.

function wpse_remove_styles() {
   wp_dequeue_style('dokan-fontawesome');
}
add_action( 'wp_print_styles', 'wpse_remove_styles', 100 );

Note: You will need the handle for the stylesheet, which you can usually get by viewing the source, finding the stylesheet ID and removing -css. For example, in your case...

<link rel='stylesheet' id='dokan-fontawesome-css' href='.../vendors/font-awesome/font-awesome.min.css?ver=2.9.10' type='text/css' media='all' />

The handle should be dokan-fontawesome.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.