Duplicate H1: hidden screen-reader title H1 rendered alongside custom layout H1 when page title is hidden
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
调研方向
Start by reading views/page-header.php, especially the hidden-title branch and its H1 check, then trace inc/views/page_header.php to understand how the view is hooked. Try reproducing the case with a hidden title and a Custom Layout H1 on both a regular page and the posts page. Done means the page renders only the custom layout H1; no relevant test coverage was found, so identify or add a regression check.
由索引模型根据 Issue 内容生成。
描述
Summary
When a page's title is hidden and a Custom Layout supplies its own H1, the page ends up with two H1 headings. The second is Neve's visually hidden title.
Expected: only one H1 on the page, the one from the custom layout.
Actual: Neve outputs an extra H1 with the screen-reader-text class in addition to the custom layout H1.
Impact: SEO and heading-checker tools flag multiple H1s on the page.
Customer context
- Product / area: Neve page header with Neve Pro Custom Layouts
- Version: Not provided
- Environment: Page using a custom layout with an H1 heading; the page title is hidden (inferred)
- Integration / third party: Neve Pro custom layouts
- Reported error / symptom: Two H1 headings reported on a page that uses a custom layout
- Impact: SEO concern; customer is using a heading checker
Reproduction notes
Not reproduced. Likely steps (inference): 1) Hide the page title through the global setting or the per-page setting. 2) Add a Neve Pro Custom Layout that renders an H1. 3) Inspect the frontend HTML for two H1 elements. Missing: Neve and Neve Pro versions, and the exact custom layout hook.
Diagnosis
Conclusion
When the title is hidden, views/page-header.php outputs a visually hidden H1 unless it finds an H1 in the post's raw post_content. Markup injected by a custom layout or hook is not in post_content, so the check does not see it and a second H1 can render. This is inferred from reading the code; no runtime reproduction was done.
Where this likely occurs
views/page-header.phpapprox. lines 15-27 and 46-56 (hide-title decision and theelsebranch):$content_has_h1is computed fromget_post_field('post_content')only. If false, it echoes thescreen-reader-textH1.inc/views/page_header.php—Page_Header::run()line 43 andrender_page_header()lines 53-67 hook the view intoneve_page_headerat priority 9.- The page the customer linked is not necessarily the blog page. The staff reply described the case as the blog/posts page, via
is_home. The archive hide-title default at lines 21-23 of the view may be involved.
Engineering notes
The H1 check looks only at post content. It does not look at output from other sources such as Neve Pro custom layouts hooked into the page header. Neve Pro was only grepped for neve_page_header usage; the custom layout rendering code was not inspected in depth. Custom layouts may also inject at other hooks.
Test coverage status
No relevant coverage was found during inspection (not exhaustive).
What to verify or explore next
- Reproduce with a Custom Layout containing an H1 on the posts page and on a regular page, with the title hidden, and count the H1 elements.
- Check whether archive and blog pages hide the title by default for new users via
neve_archive_hide_title.
Unknowns / follow-up
- Theme and Pro versions, and the hook where the customer's layout renders.
- Whether an open issue already tracks this.
Confidence
Confidence: 70/100
The hidden-title branch in views/page-header.php only checks the post's raw content for an H1. A custom layout that outputs its own H1 is not detected, so a second H1 renders. No existing GitHub issue was searched, and I did not inspect customer-side layout markup.
Source: HelpScout #3479313350
Generated by bug-report-triage (ID: bug-report-triage_6acb421c5ba113.05905873)
- 主要语言
- PHP
- 星标
- 307
- 派生
- 88
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 15
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Codeinwp/neve 的其他 Issue
-
Customizer responsive sanitizer fatals when input is an array可能已有人在做 @HardeepAsrani 于 7 天前认领。 未关闭bug-report bug-report-triage crash-report
难度 2/5 1-3 小时 新手友好度 66/100
Codeinwp/neve#4651 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Customizer controls script throws when WooCommerce is inactive and an Elementor shop template exists (woocommerce_product_catalog section missing)可能已有人在做 @girishpanchal30 于 4 天前认领。 未关闭bug-report bug-report-triage customer report
Codeinwp/neve#4653 · 3 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
feature-request-triage
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
-
feature-request-triage
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
customer report feature-request-triage
难度 4/5 3-5 天 新手友好度 52/100
维护者通常 1 天内回复
相似的 Issue
-
major-release
难度 1/5 1 小时以内 新手友好度 67/100
Intervention/image#1553 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
omegaup/omegaup#10353 · 1 条评论 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 61/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
effort: low graphiql ide impact: low scope: code quality type: chore
难度 2/5 1-3 小时 新手友好度 82/100
wp-graphql/wp-graphql#4486 ·
维护者通常 1 天内回复