yeah, probably the error that's messing things up, that'll teach me to just put untested code up on the forum ;-)
so try with this untested snippet;
add_filter('autoptimize_filter_css_defer_inline','my_ao_css_defer_inline',10,1);
function my_ao_css_defer_inline($inlined) {
if (strpos($_SERVER['REQUEST_URI'],'/how-it-works/')!==false) {
return "h2,h1{color:red !important;}";
} elseif (strpos($_SERVER['REQUEST_URI'],'/other-url/')!==false) {
return "h2,h1{color:blue !important;}";
} else {
return $inlined;
}
}
frank