• 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

    https://www.ads-software.com/plugins/autoptimize/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Frank Goossens

    (@futtta)

    That’s interesting, thanks for sharing Theo. But does this mean you don’t do any page caching?

    Thread Starter timholz

    (@timholz)

    Hi
    Some are cached but i cannot cache all pages. Pages with captche images and others, that load items conditionally cannot be cached, unfortunately.
    regards
    theo

    Thread Starter timholz

    (@timholz)

    I have to state this more precisely.
    The conditional filter of course does not work with page caching on.

    Plugin Author Frank Goossens

    (@futtta)

    The conditional filter of course does not work with page caching on.

    indeed, hence my question ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘AO filters break css styles in ie8’ is closed to new replies.