• Resolved flying-phil

    (@flying-phil)


    I keep getting the following “Parse error: syntax error, unexpected ‘<‘ in” in the code below. I’m trying to switch style sheets depending on the browser type..

    here’s the code:

    if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) {
    
    <link rel="stylesheet" href="https://magicdea.homeip.net/wp-content/themes/Magicdea/style_ie.css" type="text/css" media="screen" />;
    
    }else{
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />;

    Can anyone help??

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • jarretcade

    (@jarretcade)

    You are already inside of the PHP tags yet you are trying to use plain HTML without setting the HTML up inside of a variable. You need to do something like the following.

    <?php if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) { ?>
    
    <link rel="stylesheet" href="https://magicdea.homeip.net/wp-content/themes/Magicdea/style_ie.css" type="text/css" media="screen" />
    
    <?php } else { ?>
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    
    <?php } ?>
    Thread Starter flying-phil

    (@flying-phil)

    Thanks that fixed it!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing style sheets’ is closed to new replies.