Support » Themes and Templates » Escaping the “<?php” on my stylesheet in XHTML

  • w1sh3s

    (@w1sh3s)


    Hi All,
    My stylesheet won’t validate and work at the same time.
    I can’t figure out how to escape it correctly.

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    I’ve been trading <? for < and it validates (as XHTML Strict) and seems to work. Is there a better way?

Viewing 5 replies - 1 through 5 (of 5 total)
  • w1sh3s

    (@w1sh3s)

    That second < is actually:
    <'

    w1sh3s

    (@w1sh3s)

    Argh! < = &lt ;

    Samuel B

    (@samboll)

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    should be correct

    w1sh3s

    (@w1sh3s)

    It works, but doesn’t validate as XHTML Strict because of the < before ?php.

    How can I escape that ? ?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    It should validate because it will parse the php so

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    becomes

    <link rel="stylesheet" href="http://foo.com/wordpress/wp-content/themes/mytheme/style.css" type="text/css" media="screen" />

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Escaping the “<?php” on my stylesheet in XHTML’ is closed to new replies.