hi @sarr9121;
on clon.colsasud.com you seem to be using something to defer CSS loading which seems to be somehow breaking Autoptimize’s optimization. can you disable that so I can see what AO does?
frank
Hi Frank. thanks for your prompt response. I have disabled the css defer plugin on the clone site. I’m using the in line css option. And the page does not load the css. Everything appears as html comment.
Santiago.
this is (normally) not something AO does, looks like a plugin conflict. can you selectively disable other plugins (and briefly switch themes) to identify the culprit?
fran
Hello Frank, apparently it is something related to the theme, I have changed to the typical themes of wordpress and the plugin works. I know it’s not your theme, but you have an idea that could cause this block?
Thanks.
Santiago.
not really, should see the code … is this a theme on https://wordpress.org/themes ?
Not, is a theme from themeforest.
https://themeforest.net/item/health-plus-health-clinic-wordpress-theme/12244953
i wrote to the support page, but i still waiting for some answer.
well, as all theme’s (and plugins) are GPL you are allowed to share the code, so … π
ok i dont have problem with that. but how share you the code? all the folder have about 18 MB. or what file you need to see?
zip the folder, upload it somewhere and send me the link via mail (futtta-at-gmail-dot-com)?
Hi frank, sorry for the delay in sending, but I had to leave outside, and only so far I could return. I share you the compressed folder via mail. Any help you can give me will thank you.
no problem π
so the problem is that healthplus outputs this;
<!-- <title></title>-->
<title>futtta's local testblog – Just another WordPress site</title>
and that autoptimize injects the optimized CSS in front of the (first) title-tag it finds, which due to the healthplus code is inside the HTML-remark’ed block.
root cause fix would be for the theme dev to remove that unneeded HTML comment block.
workaround fix is to tell AO to inject the optimized CSS elsewhere using a coupld of lines of code against AO’s API, e.g.;
add_filter('autoptimize_filter_css_replacetag','fix_healthplus_css');
function fix_healthplus_css() {
return array("<!-- <title>","before");
}
(do take into account that this will only work as long as healthplus has the comment-block there, it might be safer to inject elsewhere after all)
frank
Bravoooooo, you are a Master.
Thankyou very much for your help.
Now I have to test the plugin to improve the loading times of the page. Above all, try the inline and defer function, thanks again.