FlyingPress minifies CSS files by default to reduce size and improve performance. If a CSS file breaks or causes layout issues after minification, you can exclude it using the flying_press_exclude_from_minify:css
filter.
Where to add this code
You can add the snippet to:
Your theme’s
functions.php
fileA custom plugin
A plugin like Code Snippets
Example: Exclude CSS files from minification
add_filter('flying_press_exclude_from_minify:css', function ($exclude_keywords) {
return [
'custom-style.css',
'my-theme/',
'/themes/',
'/plugins/sample-plugin/'
];
});
How it works
The filter checks if any part of the CSS file URL contains one of the keywords. Matching is partial and case-sensitive.
You can use:
File name:
'custom-style.css'
matches/css/custom-style.css
Folder path:
'my-theme/'
matches/themes/my-theme/style.css
Theme-wide exclusion:
'/themes/'
excludes all CSS from any themePlugin-wide exclusion:
'/plugins/'
excludes all plugin CSS filesSpecific plugin:
'/plugins/sample-plugin/'
excludes only that plugin’s CSS
Notes
Use this filter only when a file breaks after minification
Excluded files will still be processed for other optimizations (like defer or preload) unless excluded separately
To exclude JavaScript files from minification, use the
flying_press_exclude_from_minify:js
filter