Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#30057 closed defect (bug) (fixed)

Twenty Fifteen: Site description is not a heading, replace the h2 element for a p

Reported by: rianrietveld's profile rianrietveld Owned by: iandstewart's profile iandstewart
Milestone: 4.1 Priority: normal
Severity: normal Version: 4.1
Component: Bundled Theme Keywords: has-patch needs-testing commit
Focuses: accessibility Cc:

Description

The site description (bloginfo( 'description' )) should not be defined as an H2 heading in header.php
It is not a section or content title.
Therefore it will be better to place the site description inside a <p> element.
Since the styling is done with a class, it will have no impact on the visual presentation.

Attachments (2)

30057.patch (710 bytes) - added by rianrietveld 9 years ago.
Replaces the H2 for a p for the site description in header.php
30057.1.diff (1.2 KB) - added by iamtakashi 9 years ago.
Updated patch from the root. Remove inherited bottom margin.

Download all attachments as: .zip

Change History (13)

@rianrietveld
9 years ago

Replaces the H2 for a p for the site description in header.php

#1 @rianrietveld
9 years ago

  • Keywords has-patch needs-testing added

Added patch

#2 @SergeyBiryukov
9 years ago

  • Summary changed from Site description is not a heading, replace the h2 element for a p in Twentyfifteen to Twenty Fifteen: Site description is not a heading, replace the h2 element for a p

This ticket was mentioned in IRC in #wordpress-dev by iandstewart. View the logs.


9 years ago

#4 follow-up: @georgestephanis
9 years ago

We've been rather inconsistent to date in using h1/h2 for site title/site description --

As long as it's clustered in an hgroup, it should be fine semantically, imho.

Last edited 9 years ago by georgestephanis (previous) (diff)

#5 in reply to: ↑ 4 @bramd
9 years ago

Replying to georgestephanis:

As long as it's clustered in an hgroup, it should be fine semantically, imho.

Hgroup has been removed from the HTML 5 spec:

http://html5doctor.com/the-hgroup-element/

Furthermore, from an accessibility point of view there was no assistive tech that handled the hgroup element, so the relation between the h1 and h2 was not obvious. Since we don't have a describing h2 for the menu/main navigation, it might seem that the h2 with site description is a heading for the following section to users of AT, which it is not.

#7 follow-up: @iamtakashi
9 years ago

Just to note that Twenty Fifteen doesn't use hgroup.

#8 @rianrietveld
9 years ago

The reason I posted this in a separate ticket is that this is a quick fix, with no consequences on any functionality and it improves accessibility. It also takes this heading out of the equation on how headings should be implemented like in ticket #30065.
A heading should point to content, and here that's not the case.

#9 in reply to: ↑ 7 @georgestephanis
9 years ago

Replying to iamtakashi:

Just to note that Twenty Fifteen doesn't use hgroup.

Whoops, my mistake. Eyes glossed over after the other five.

@iamtakashi
9 years ago

Updated patch from the root. Remove inherited bottom margin.

#10 @iandstewart
9 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 4.1

<p> is good for me.

#11 @iandstewart
9 years ago

  • Owner set to iandstewart
  • Resolution set to fixed
  • Status changed from new to closed

In 30009:

Twenty Fifteen: Use a p for the site description for a better experience when using a screenreader.

Props rianrietveld, fixes #30057, see #30065.

Note: See TracTickets for help on using tickets.