Closed philbuchanan closed 3 years ago
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 :thinking:
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 Yes, I am using a "classic" theme. It is a custom theme though.
I think I see what's happening... Marked this as a bug and assigned to myself. I'll look into this :+1: (also added the backport-to-wp tag 'cause this feature is in WP5.8 for block templates)
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:
My "skip to content" link:
WordPress information
Device information