admin管理员组

文章数量:1405136

/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.

/

/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/

Share Improve this question edited Dec 19, 2019 at 22:17 RiddleMeThis 3,8078 gold badges22 silver badges30 bronze badges asked Dec 19, 2019 at 21:54 adam skadam sk 93 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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.

本文标签: cssPlugin and themes are adding the same stylesheets