yeah, with a couple of lines of code against AO’s API, somethink like this (warning, untested, I’m not “in the office” this week);
add_filter('autoptimize_filter_noptimize','optimize_home',10,0);
function optimize_home() {
if ( is_home() || is_front_page() ) {
return false;
} else {
return true;
}
}
hope this helps,
frank
Indeed that worked fine. Thanks for your prompt response frank
Hi Frank!
Thanks for this plugin, I think it works really well and is an important one to use 🙂
I have a similar question. Is it possible to only inject the critical CSS on the homepage?
The filter above does that, but the scripts and styles is not concatenated, which I still want them to be.
Thanks!
I *think* this might work (no time to test myself now);
add_filter('autoptimize_filter_css_defer','defer_home',10,0);
function defer_home() {
if ( is_home() || is_front_page() ) {
return true;
} else {
return false;
}
}
frank
Worked like a charm! Thanks Frank!
Gotta love those filters 😉
Where are you adding this script?
Edit: Nevermind I got it :p