WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Theme using HTML 4.0 (7 posts)

  1. graemep
    Member
    Posted 7 years ago #

    I wanted to create a theme using HTML 4.01 strict. However WordPress inserts a link tag (the EditURI one) which is self closed XHTML style so it will not validate.

    Can I change this behaviour. In fact I do not really want the Edit URL link and would prefer to get rid of it.

    Are there any other problems I am likely to encounter (other than certain plugins)?

  2. Christopher J. Hradil
    Member
    Posted 7 years ago #

    what's wrong with the XHTML transitional standard ? or XHTML strict for that matter, both of which support/require self closing tags as appropriate.

  3. yosemite
    Member
    Posted 7 years ago #

    I agree with chradil, and am confused why you'd have a validation error. Am I Missing something graemep?

  4. Yngwin
    Member
    Posted 7 years ago #

    Add this to the top of the header.php of your theme:
    function htmlize($buffer) {
    return (preg_replace("!s*/>!", ">", $buffer));
    }
    ob_start("htmlize");

    That will strip the self-closing bits.

  5. graemep
    Member
    Posted 7 years ago #

    Thanks Yngwin

    Yosemite, self closing tags are not valid HTML. It is not a huge problem in practice because most browsers ignore the slash, but it is nice to get pages to validate.

    chradil, I want to use HTML 4 because its the best way to get as many browsers as possible into standards mode. See this table.

    XHTML strict also looks OK from this point of view, but I am more familiar with HTML.

    I also need to use snippets of other code (web stats, ads etc) and these are more likely to be valid HTML than XHTML 1.0 strict. That said most of what I use at the moment does validate as XHTML 1.0 transitional so it SHOULD be OK.

    Then there is the whole issue of sending XHTML as text/html, although I do not really understand what the practical implications of that are.

  6. Pospiech
    Member
    Posted 7 years ago #

    About usage of strict modes one should read
    'Strict Is Just Another Quirky Mode'
    http://www.kdedevelopers.org/node/2097

  7. Yngwin
    Member
    Posted 7 years ago #

    Well, that's just an opinion, and a limited one at that. I'm sure most standards-aware web developers don't agree with that view.

Topic Closed

This topic has been closed to new replies.

About this Topic