WordPress.org

Ready to get started?Download WordPress

Forums

Escaping the "<?php" on my stylesheet in XHTML (6 posts)

  1. w1sh3s
    Member
    Posted 5 years ago #

    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?

  2. w1sh3s
    Member
    Posted 5 years ago #

    That second < is actually:
    <'

  3. w1sh3s
    Member
    Posted 5 years ago #

    Argh! < = &lt ;

  4. Samuel B
    moderator
    Posted 5 years ago #

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

  5. w1sh3s
    Member
    Posted 5 years ago #

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

    How can I escape that ? ?

  6. 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" />

Topic Closed

This topic has been closed to new replies.

About this Topic