Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Duplicate H1: hidden screen-reader title H1 rendered alongside custom layout H1 when page title is hidden

Aperta
#4,652 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@HardeepAsrani ci sta già lavorando.

Dal 12/10/2026.

  • #4658 di @HardeepAsrani — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php, wordpress

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug-report bug-report-triage customer report

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.php approx. lines 15-27 and 46-56 (hide-title decision and the else branch): $content_has_h1 is computed from get_post_field('post_content') only. If false, it echoes the screen-reader-text H1.
  • inc/views/page_header.php — Page_Header::run() line 43 and render_page_header() lines 53-67 hook the view into neve_page_header at 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)

Lingua principale
PHP
Stelle
307
Fork
88
Merge medio
2g 21h
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Codeinwp/neve

Tutte le issue di Codeinwp/neve

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.