[wp-trac] [WordPress Trac] #51944: TwentyTwentyOne: The main element must not appear as a descendant of the section element.
WordPress Trac
noreply at wordpress.org
Sat Dec 5 10:37:27 UTC 2020
#51944: TwentyTwentyOne: The main element must not appear as a descendant of the
section element.
------------------------------+-----------------------------
Reporter: albertomake | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: 5.6
Severity: normal | Keywords: needs-patch
Focuses: coding-standards |
------------------------------+-----------------------------
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.
(https://core.trac.wordpress.org/ticket/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!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51944>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list