Archived topic
HERO and validator.w3.org problem
9 replies · Started by detanatar on December 10, 2020
1) the validator shows that everything is fine
2) deactivate the page title
3) create a Header element
4) <h1 class = "entry-title" itemprop = "headline"> {{post_title}} </h1>
5) activate it for the whole site
6) the validator shows an error Warning: Article lacks heading. ---- Consider using h2-h6 elements to add identifying headings to all articles.
such an error occurs probably because the original H1 is located at the same level as
<article id="post-2" class="post-2 page type-page status-publish has-post-thumbnail" itemtype="https://schema.org/CreativeWork" itemscope>
and has the following form
<article id="post-2" class="post-2 page type-page status-publish has-post-thumbnail" itemtype="https://schema.org/CreativeWork" itemscope>
<h1 class="entry-title" itemprop="headline">CONTENT</h1>
</header>
if you insert an H1 element, then it is inserted above
<article id="post-2" class="post-2 page type-page status-publish has-post-thumbnail" itemtype="https://schema.org/CreativeWork" itemscope>
Hi there,
can you share a link to a page where i can see the validation issue?
sent access
main page
a validation error occurs when integrating your H1
It doesn't look like your page has any other headings e.g H2 to H6 which seems to be main issue. Have you tried including a H2 in your content ?
when you turn on H2, the error disappears.
BUT
With the default H1, there is no error in the absence of other headers
enabling H2 header masks the problem but does not solve
If you use the Header element to display the <h1> post title then yes, it moves it outside of the article tag, this is a user design choice. If you want to maintain the H1 inside your content then you need to remove the H1 post title from the header element.
But the simple fix is to include better heading structure in your content which is why the validator suggests Consider using h2-h6 elements to add identifying headings to all articles.
Thank you David.
I will take into account the future
You're welcome