Browser Specific Question
-
I am using the following code in my header.php file to call a specific stylesheet for IE users, Firefox users, and everyone else lumped into one file for now.
Can you all take a look and see where my issue is? I can’t exactly get this to work yet. I may be calling in the wrong place, in the wrong php file, or maybe all wrong altogether. I also placed it inside the head.
Thanks in advance. (FYI…style1 is my IE stylesheet, style2 is my Firefox stylesheet, and style is my primary stylesheet)
<?php if (strpos(true == $_SERVER[‘HTTP_USER_AGENT’],’Gecko’)) { ?>
<link rel=stylesheet type=”text/css” href=”<?php bloginfo(‘stylesheet_directory’); ?>/style1.css”>
<?php } elseif (strpos(true == $_SERVER[‘HTTP_USER_AGENT’],’IE’)) { ?>
<link rel=stylesheet type=”text/css” href=”<?php bloginfo(‘stylesheet_directory’); ?>/style2.css”>
<?php } else { ?>
<link rel=stylesheet type=”text/css” href=”<?php bloginfo(‘stylesheet_directory’); ?>/style.css”>
<?php } ?>
The topic ‘Browser Specific Question’ is closed to new replies.