#51944 closed defect (bug) (fixed)
Twenty Twenty-One: The main element must not appear as a descendant of the section element.
Reported by: | albertomake | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.6 | Priority: | normal |
Severity: | normal | Version: | 5.6 |
Component: | Bundled Theme | Keywords: | has-patch commit dev-reviewed |
Focuses: | accessibility, coding-standards | Cc: |
Description (last modified by )
Hi, on the header.php in the twentytwentyone theme we can see this at the end of the document:
<div id="content" class="site-content"> <section id="primary" class="content-area"> <main id="main" class="site-main" role="main">
The problem here is that the main element must not appear as a descendant of the section element.
I raised a similar ticket two years ago for the twentynineteen theme where I proposed to change the section element for a div. (#47066).
Also, this change involves changing the closing section element in the footer.php:
</main><!-- #main --> </section><!-- #primary --> </div><!-- #content -->
The solution for the header and footer files would look like this:
header.php
<div id="content" class="site-content"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main">
footer.php
</main><!-- #main --> </div><!-- #primary --> </div><!-- #content -->
Thanks!
Attachments (1)
Change History (11)
#3
@
4 years ago
- Description modified (diff)
- Milestone changed from Awaiting Review to 5.6
Hi there, welcome back to WordPress Trac! Thanks for the report.
Looking at #47066, this is much easier to fix before the release, otherwise there would be backward compatibility concerns and we'd need to write a dev note like the one for a similar change to Twenty Nineteen in WordPress 5.3.
Based on the above, moving this to 5.6. I don't think this will require another RC before the final release.
#4
@
4 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 49759:
#5
@
4 years ago
- Keywords commit dev-feedback added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for backporting to the 5.6 branch after a second committer's review.
This ticket was mentioned in Slack in #core-committers by hellofromtonya. View the logs.
4 years ago
#7
@
4 years ago
- Keywords dev-reviewed added; dev-feedback removed
Approved for commit to 5.6 branch.
Review notes:
- confirmed HTML is correct on home, category archive, post, page and media
- confirmed neither
#primary
or.content-area
selectors were overloaded withsection
in CSS
#8
@
4 years ago
- Summary changed from TwentyTwentyOne: The main element must not appear as a descendant of the section element. to Twenty Twenty-One: The main element must not appear as a descendant of the section element.
Replace section with div