• Resolved graemep

    (@graemep)


    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)?

Viewing 6 replies - 1 through 6 (of 6 total)
  • what’s wrong with the XHTML transitional standard ? or XHTML strict for that matter, both of which support/require self closing tags as appropriate.

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

    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.

    Thread Starter graemep

    (@graemep)

    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.

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

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Theme using HTML 4.0’ is closed to new replies.