Site logo

[Resolved] How to activate zoom function ?

Home Forums Support [Resolved] How to activate zoom function ?

Home Forums Support How to activate zoom function ?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.

    #2518600
    David
    Staff
    Customer Support

    Hi 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?

    #2518728
    Gilles

    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…

    #2518777
    David
    Staff
    Customer Support

    Ok, so thats correct the one that the theme adds.

    BUT there is a second one in the head of 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: viewport

    Your site shows there are 4 instances. You can ignore the 3rd and 4th ones as they are in an iFrame.

    #2518807
    Gilles

    Ok, I found the 2 plugins possibly responsable of that… I will see that with them.
    Thanks

    #2519741
    David
    Staff
    Customer Support

    Let us know how you get on

    #2519756
    Gilles

    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.
    Thanks

    #2519963
    David
    Staff
    Customer Support

    Glad to hear that ! and thanks for lettings us know, as others may find this useful 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.