Support » Fixing WordPress » Default Theme Does Not Validate?

  • Hi,

    I thought the WordPress Default Theme (unmodified) should validate?

    Line 34, Column 23: Attribute “role” is not a valid attribute. Did you mean “frameborder” or “scrolling”?

    <div id=”header” role=”banner”>

    I know why this error is occuring (because role isn’t part of the XHTML spec), so why is it included in the default theme, surely this theme should validate seeing as it is the default theme?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Oh – I know! And I agree that it should validate. An XHTML document shouldn’t include HTML5 attributes. You want those attributes? Then create an HTML5 theme.

    Raised it in Trac as a bug only to get it knocked back on the grounds that including the role attribute “enhanced accessibility” (which is tosh when there are so many other areas where accessibility actually needs to be enhanced in WP) and that invalidity is a small price to pay for this.

    Personally, I think this is accessibility lip-service – not accessible design – which angers me just as much as inaccessible design. Grrrr…

    Actually Roles are not HTML5 but WAI-ARIA Landmark Roles.

    And this survey here, shows that a significant percentage of disabled users are already using them.

    Hardly lip service. I’m a stickler for standards and validating pages, but I’m also practical, and when there is a measurable benefit to accessibility, I don’t mind a couple of invalid attributes.

    Whilst WordPress needs work on accessibility on the back end, the front end is pretty accessible out of the box.

    In fact, one of only two WCAG 2.0 AAA certified sites in the world is a WordPress site (, and a pretty vanilla one at that.



    Hardly lip service

    I think it is whilst the search is problematic (try an empty search) and gallery CSS is placed within the <body> tags. The first is a significant access issue. The second a major validation and user/owner issue. Both could be easily fixed. Then there’s a default template that uses px fonts with a 62% body font, no skip links, text that fails minimum contrast levels, multiple identical link texts that point to completely different resources.

    All very fixable. In this context, throwing in a few role attributes seems very bizarre to me.

    Thanks esmi + Mike for the information, you both provide interesting arguments. It does seem like a bit of a trade-off between validity and accessiblity, although we never know how a browser will interpret invalid code, unless it’s one of those occasions where you know for sure you can ignore the validator, wherby this could be one.

    Although I admit I was surprised to find it didn’t validate as I always though WP came out of the box as w3 XHTML/CSS valid.

    The empty search is a bit odd, re-directs me to my homepage very strange behaviour! Although in general i’ve read the WP search needs a lot of improvement.

    esmi I agree it seems sort of like a “pick and choose” scenario, when they could easily implement a lot more with regards to accessibliy!

    I posted a simple (but still not perfect) fix for the “empty searches” issue on

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Default Theme Does Not Validate?’ is closed to new replies.