#52938 closed defect (bug) (fixed)
Twenty Twenty-One: H1 is misplaced for a page set as blogpost container
Reported by: | rianrietveld | Owned by: | sabernhardt |
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | 5.6 |
Component: | Bundled Theme | Keywords: | has-patch has-screenshots commit |
Focuses: | ui, accessibility | Cc: |
Description
When a page is used to display the blogposts, the H1 isn't the page title but the site title in the header. This results in an H1 that doesn't represent the content of the page.
How to reproduce:
In the Admin go to Settings > Reading.
With "Your homepage displays" select "A static page (select below)" and for the Posts page select an existing page.
Expected result:
The page title is the (visual) H1, which is set above the listed posts.
The same way the posts of category are displayed.
Attachments (4)
Change History (23)
#1
@
4 years ago
- Summary changed from H1 is misplaced for a page set as blogpost container in Twenty Twenty-One to Twenty Twenty-One: H1 is misplaced for a page set as blogpost container
#3
@
4 years ago
i tested 52938.diff but it will not return any title and show an empty header tag. @justinahinon is the above patch working for you?
#4
@
4 years ago
@mukesh27 yes, I do have the title on blog page.
How you can test:
- On a fresh install with Twenty Twenty-One, create a page (Blog for instance)
- Go to Settings > Reading and select the page created as the "Posts page"
- Go to the new created page on the frontend and you should see its title at the top of the page. See this screenshot https://cln.sh/0Bv0jw.
#5
follow-up:
↓ 6
@
4 years ago
@justinahinon thanks for confirming.
If we select the Posts page as the existing page then it will show the title of that page.
But For Settings > Reading > Your latest posts option shows an empty title. https://tinyurl.com/yez25bbn
#6
in reply to:
↑ 5
@
4 years ago
Replying to mukesh27:
But For Settings > Reading > Your latest posts option shows an empty title. https://tinyurl.com/yez25bbn
I noticed this. Thanks for flagging. Working on updating the patch.
#7
@
4 years ago
@mukesh27 in 52938-1.diff, I checked if the page is not the default front page and is is_home()
is true.
But I'm still seeing an edge case where this will display an empty title. When in Settings > Readings, "A static page" is selected, a page is set as "Posts page" but no page is set as "Homepage". The site homepage will display an empty title.
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
4 years ago
@
4 years ago
adds heading to blog page only if title exists, removes the H1 from posts page site-title
#10
@
4 years ago
- Keywords has-patch needs-testing added
- Owner set to sabernhardt
- Status changed from new to accepted
Thanks for the patches!
The site-branding template needed editing, too, so it would not have two H1 headings.
For edge cases, 52938.2.diff simply does not output the header and H1 tags if there is no title (without the prefix). This could result in no H1 for the page, but I think that's better than outputting an empty tag.
#11
follow-up:
↓ 12
@
4 years ago
Patch 52938.2.diff working fine for me in latest version 5.8-alpha-50787
@justinahinon can you please test the patch so we can remove needs-testing
keyword
#12
in reply to:
↑ 11
@
4 years ago
Replying to mukesh27:
Tested with fresh WordPress 5.8-alpha-50427-src.
Works fine for me.
But I'd suggest we keep the need-testing tag for a bit, so that other people can test also.
This ticket was mentioned in Slack in #core-test by boniu91. View the logs.
4 years ago
#15
@
4 years ago
Tested on
- MacOS 11.3
- Safari 14.1
- WordPress 5.8-alpha-50427-src
Patch 52938.2.diff works fine for me
#16
@
4 years ago
- Keywords needs-testing removed
Removing the needs-testing feedback after @francina's test.
@audrasjb, at this point, can we add the commit tag to the ticket?
#17
@
4 years ago
- Keywords has-screenshots commit added; has-testing-info removed
I tested the proposed patch and I can confirm it shows the single_post_title
in a <h1>
tag (which is "a Blog page" when using the Theme Unit Test dataset and when this page is defined as the blog page). Also, the site title uses a <p>
tag.
Good to go!
This patch adds the page header to the blog posts page