[Plugin: WP Super Cache] Browser-specific stylesheets in wp-cache pages?
-
I have a simple bit of PHP code in the head section of my pages to load an Internet Explorer-specific stylesheet if necessary:
<?php $useragent = $_SERVER['HTTP_USER_AGENT']; if (stristr ($useragent, 'MSIE')) { echo ('<link rel=stylesheet href="https://www.domain.org/nwwstyleIE.css" type="text/css">'); } ?>
Since most readers use MSIE, pages tend to be wp-cached <i>with</i> the MSIE stylesheet. (Ignoring for now the super-cached pages for logged-in users, most of whom use Firefox thus creating the opposite issue.)
The result is that non-MSIE readers get a messed-up layout. Or MSIE readers get a messed-up layout if the page was first viewed by a Firefox or Safari user.
How can I still dynamically supply the MSIE stylesheet in the cached file as needed? Javascript (which I unfortunately don’t know at all well)?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘[Plugin: WP Super Cache] Browser-specific stylesheets in wp-cache pages?’ is closed to new replies.