Hello @adaptablewebsites,
The drop-down list contains CSS Styles which are added to the code of your site through standard coding procedures. CSS Styles which were added not following the standard coding recommendations, would not show up there. For these, you need to use exclusion code filters. For these, you have to find or know the handle of the style and not the style sheet name directly.
Here is a post here which explains how you can find the handle for each one of your styles and then how to exclude it. You may also contact the developer of the theme / plugin the style of which you want to exclude and they should be able to provide you with the handle name.
Regards,
Plamen.M
SiteGround Technical Support Team
Hi,
Thanks for the prompt and detailed answer.
Alas it seems there is no data handle that I can find, or that is applied, for the css style sheet I added on this page:
https://hivefitnessbristol.co.uk/book/
https://hivefitnessbristol.co.uk/wp-content/uploads/2022/02/hivefitness-gymcatch.css
I have used the Identify Handle SGO Filter but no handle is associated with the above css file. Also, I have tried using the name of the file i.e. hivefitness-gymcatch as the data handle ID in the exclude list which is advised that SGO uses. This hasn’t worked either. The filter used:
add_filter( 'sgo_css_combine_exclude', 'css_combine_exclude' );
function css_combine_exclude( $exclude_list ) {
// Add the style handle to exclude list.
$exclude_list[] = 'hivefitness-gymcatch';
return $exclude_list;
}
No luck. I have left the combine css setting on temporarily FYI
Thanks for your help. Appreciate it.
Regards Mark
Hello Mark,
Unfortunately, without the handler, I do not think the custom snippet will be of any help. Something else you could try is to include the CSS file via Divi and then work around if content needs to be excluded or not.
Best Regards,
Simeon Boev
Simeon
Thanks for coming back so quick … appreciate it.
I can see the css from the css file in the SG assetts css file. As SG Optimiser has added it … should it not have provided the handler as the name part of the css file … in this case … hivefitness-gymcatch
CSS file is: https://hivefitnessbristol.co.uk/wp-content/uploads/2022/02/hivefitness-gymcatch.css
Am I mistaken in my thinking. Just trying to understand the problem I have and how I may solve effectively in the long-term
Thanks
Regards Mark
Hello Mark,
The handle does not always match the file name. We can help you find the proper handle if you provide us with the exact page where the CSS file should be loaded as we need to trigger the CSS code execution.
Regards,
Delyan Delov
Delyan,
Thanks for clarifying this.
The page in question: https://hivefitnessbristol.co.uk/book
The CSS loaded is:
<link rel=”stylesheet” href=”https://hivefitnessbristol.co.uk/wp-content/uploads/2022/02/hivefitness-gymcatch.css”>
Combine CSS Files is off in SGO
Many Thanks
Regards Mark
I have examined your site and it seems that the file in question is not included properly as its code is not loaded on the site.
Please revise your CSS implementation and make sure the file is correctly included and loaded on the site.
Regards,
Delyan Delov
Delyan,
This: https://hivefitnessbristol.co.uk/book/
View Page Source … shows this:
<link rel=”stylesheet” href=”https://hivefitnessbristol.co.uk/wp-content/uploads/2022/02/hivefitness-gymcatch.css”>
Browsers show a change from the stylesheet i.e. calendar function etc shows the green of the brand which is being implemented by the stylesheet.
Would you be kind enough to check again .. doesn’t make a lot of sense.
Many Thanks, Mark
Hello Mark,
I checked the site, and the issue probably comes from the way the stylesheet is included on the page.
<link rel="stylesheet" href="https://hivefitnessbristol.co.uk/wp-content/uploads/2022/02/hivefitness-gymcatch.css">
In their documentation (p.4 below) they specify that the CSS can be included there however it needs to be wrapped in <style></style> tags:
https://www.divithemeexamples.com/add-custom-css-to-divi/
Please try using one of the methods described in their documentation and it should be working correctly.
-
This reply was modified 4 years, 4 months ago by
Pavel Dosev.
-
This reply was modified 4 years, 4 months ago by
Pavel Dosev.
Hello,
Other minifying plugins, for example WP Fastest Cache – offer an option to add a filter that searches for strings in the JS or CSS and exclude. This works whether or not the CSS or JS was added properly in WordPress or not. Could you include this in future updates? Right now a number of sites I’d prefer to use SG optimizer, but I have to use WP Fastest Cache instead because I can’t exclude CSS / JS, and WPFC doesn’t play well with your server’s cache settings so it’s a big headache.
I will pass your suggestion to our developers so they can consider such functionality for future releases.
Best Regards,
Delyan Delov