Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip to content link is added even if theme includes a skip to content link #32433

Closed
philbuchanan opened this issue Jun 3, 2021 · 3 comments · Fixed by #32451
Closed

Skip to content link is added even if theme includes a skip to content link #32433

philbuchanan opened this issue Jun 3, 2021 · 3 comments · Fixed by #32451
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@philbuchanan
Copy link

In a more recent version of Gutenberg (not sure entirely which version) a feature was added to automatically add a "skip to content" link. This link is added even if the theme includes a skip to content link itself. This results in a double "skip to content" link.

Expected behaviour

I would expect the auto "skip to content" link to be an opt-in feature. I'm also not currently aware of how to opt-out. But if I must opt-out, I will need to update every site I have created in the past. Since I create custom themes for each client, that will result in a lot of additional work.

Screenshots or screen recording (optional)

WordPress auto "skip to content" link:

Screen Shot 2021-06-03 at 10 01 46 AM

My "skip to content" link:

Screen Shot 2021-06-03 at 10 01 52 AM

WordPress information

  • WordPress version: 5.7.2
  • Gutenberg version: 10.7.1
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? No

Device information

  • Device: Mac
  • Operating system: macOS 11.4
  • Browser: Safari 14.1.1
@aristath
Copy link
Member

aristath commented Jun 3, 2021

Thank you for reporting this @philbuchanan
The automatic skip-link should only be added when using a block theme (full site editing enabled).
Nothing should be added for "classic" themes, are you saying you're seeing a duplicate skip-link when using a classic theme? I tested this with the twentytwenty theme (which adds its own skip-link) and gutenberg-trunk, I didn't see a duplicate 🤔

block themes don't have access to PHP templates, so when using such theme, an automatic skip-link is generated when possible and added.

@aristath aristath added the [Status] Needs More Info Follow-up required in order to be actionable. label Jun 3, 2021
@philbuchanan
Copy link
Author

@aristath Yes, I am using a "classic" theme. It is a custom theme though.

@aristath aristath added [Type] Bug An existing feature does not function as intended Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Jun 3, 2021
@aristath aristath self-assigned this Jun 3, 2021
@aristath
Copy link
Member

aristath commented Jun 3, 2021

I think I see what's happening...
Marked this as a bug and assigned to myself. I'll look into this 👍
(also added the backport-to-wp tag 'cause this feature is in WP5.8 for block templates)

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jun 4, 2021
@youknowriad youknowriad removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants