AO filters break css styles in ie8
-
Hi
Ie8 maybe obsolete, but statistics show, that is still used.
This maybe useful for those who aim to exclude undesired results in ie8 applying AO filters.
I recently put the AO replacetag- and AO css include inline Filters in my functions.php. The result was, that in ie8 the styling wasn’t correct anymore.
I altered the filters as shown below and then everything was fine.add_filter('autoptimize_filter_css_replacetag','my_ao_override_css_replacetag',10,1); function my_ao_override_css_replacetag($replacetag) { $ua = $_SERVER['HTTP_USER_AGENT']; $msie_8 = strpos($ua, 'MSIE 8.0') ? true : false; if ($msie_8 == true){ return array("<head>","after"); } else{ return array("</head>","before"); } } add_filter('autoptimize_css_include_inline','my_ao_css_include_inline',10,1); function my_ao_css_include_inline() { $ua = $_SERVER['HTTP_USER_AGENT']; $msie_8 = strpos($ua, 'MSIE 8.0') ? true : false; if ($msie_8 == true){ return false; } else{ return true; } }
regards
theo
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘AO filters break css styles in ie8’ is closed to new replies.