- This topic has 7 replies, 2 voices, and was last updated 3 years, 3 months ago by
David.
-
AuthorPosts
-
February 2, 2023 at 7:19 am #2518560
Gilles
Hello,
When testing my site https://www.un-jardin-bio.com/ with PageSpeed Insights, I got a warning “The [user-scalable=”no”] attribute is used in the <meta name=”viewport”> element, or the [maximum-scale] attribute is less than 5.” (see here: https://i.imgur.com/dmxbwru.jpeg).
If I understand correctly, this prevents the activation of the zoom.
I imagine it comes from the theme… But I don’t see how to correct this, and therefore make zooming possible.
Thanks.February 2, 2023 at 7:46 am #2518600David
StaffCustomer SupportHi there,
this is the default viewport meta tag that theme inserts:
<meta name="viewport" content="width=device-width, initial-scale=1">Which is different to what you have.
We provide a filter hook to change that:https://docs.generatepress.com/article/generate_meta_viewport/
Did you use that in a custom function?
February 2, 2023 at 8:17 am #2518728Gilles
Hi David,
Since I had this error message first (<meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0″>), I added this code in functions.php of my child theme:
add_filter( ‘generate_meta_viewport’, function() {
return ‘<meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=5″ />’;
} );
It didn’t change anything…
I just deleted this code and I have this message again: “<meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0″> ”
I don’t understand where this can come from…February 2, 2023 at 8:47 am #2518777David
StaffCustomer SupportOk, so thats correct the one that the theme adds.
BUT there is a second one in the
headof your site, which looks like this:<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">Thats not coming from the Theme.
Try disabling plugins to see if one of those is adding it.To check if its there. Right Click > Inspect to open the Browser Developers tools, and CTRL + F to open the search field and search for:
viewportYour site shows there are 4 instances. You can ignore the 3rd and 4th ones as they are in an iFrame.
February 2, 2023 at 9:16 am #2518807Gilles
Ok, I found the 2 plugins possibly responsable of that… I will see that with them.
ThanksFebruary 3, 2023 at 2:22 am #2519741David
StaffCustomer SupportLet us know how you get on
February 3, 2023 at 2:31 am #2519756Gilles
Following your advice, I found the plugin that was causing the problem…
It was PDF Embedder Premium, for which I had disabled zoom… I unchecked the relevant box. And the warning disappeared.
ThanksFebruary 3, 2023 at 6:03 am #2519963David
StaffCustomer SupportGlad to hear that ! and thanks for lettings us know, as others may find this useful 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.