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

Using a user edited/created page template creates a duplicate viewport meta #36528

Closed
ndiego opened this issue Nov 16, 2021 · 8 comments
Closed
Labels
Needs Technical Feedback Needs testing from a developer perspective.

Comments

@ndiego
Copy link
Member

ndiego commented Nov 16, 2021

Description

This is an odd one. If you assign a theme-provided custom page template to a page, the frontend output looks roughly like this.

image

If you then edit the template in WordPress (not in the theme files) and save, the frontend output now has a duplicate meta viewport tag.

image

You get the same output if you create a new page template from within the Block Editor.

The issue can be easily reproduced with the Twenty Twenty-Two theme, but has been reproduced in a number of other themes including emptytheme.

I am happy to explore further and work on a fix, but I am not sure where to start looking. If someone can point me to where the frontend output for templates "lives", I will take a look.

Step-by-step reproduction instructions

  1. Install the latest version of Twenty Twenty-Two
  2. Add a new page and give it the template "Page (No Separators)" and publish.
  3. Look at the frontend markup and you will see only one meta viewport tag.
  4. Now from within the Block Editor, make a change to the "Page (No Separators)" and save it.
  5. Now refresh the page on the frontend and you will now see the duplicate meta viewport tags.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 5.8.2, Gutenberg 11.9

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@talldan talldan added Needs Technical Feedback Needs testing from a developer perspective. Needs Testing Needs further testing to be confirmed. labels Nov 23, 2021
@talldan
Copy link
Contributor

talldan commented Nov 23, 2021

Looks like it could be the same issue as reported here - https://core.trac.wordpress.org/ticket/53743

@ndiego
Copy link
Member Author

ndiego commented Nov 23, 2021

Yeah that looks like it's the same issue.

@carolinan
Copy link
Contributor

This PR included the solution for the title tag: #36133
But more testing is needed to see if this is still an issue in 5.9 beta.

@carolinan
Copy link
Contributor

Yes, still an issue on 5.9 beta 3 with Gutenberg trunk. When Gutenberg is not active, the tags are not duplicated.

@kafleg
Copy link
Member

kafleg commented Dec 21, 2021

WordPress: 5.9 Bets
Gutenberg: Trunk Version Activated
Theme: TT2

image

when Gutenberg is not activated,
WordPress: 5.9 Bets
Gutenberg: Not activated
Theme: TT2
image

@carolinan carolinan removed the Needs Testing Needs further testing to be confirmed. label Dec 21, 2021
@kafleg
Copy link
Member

kafleg commented Dec 23, 2021

Tested with Beta 4 as well, the issues is still there.

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

@bgardner
Copy link

bgardner commented Feb 3, 2022

Bumping as this is still a present issue.

@ndiego
Copy link
Member Author

ndiego commented Sep 29, 2022

This no longer seems to be an issue in the latest version of WordPress, Gutenberg and with TT3.

@ndiego ndiego closed this as completed Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Technical Feedback Needs testing from a developer perspective.
Projects
None yet
Development

No branches or pull requests

5 participants