[Resolved] Meta Viewport not Working

Home Forums Support [Resolved] Meta Viewport not Working

Home Forums Support Meta Viewport not Working

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1551036
    Sai

    I have tried adding <meta name=”viewport” content=”width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=1″ /> in multiple ways to my site.

    I’ve tried using header.php, using GP Hooks, using a Plugin (https://wordpress.org/plugins/definitely-allow-mobile-zooming/). None of it seems to work.

    While the page is not fully loaded, I can pinch and zoom. But once it loads fully, it does not work.

    That makes me think something is overriding the meta viewport tag but I can’t figure out what.

    The page to test is https://coachfoundation.com/blog/coaching-business-while-working-full-time/

    #1551645
    David
    Staff
    Customer Support

    Hi there,

    try adding this PHP Snippet to your site:

    add_filter( 'generate_meta_viewport', function() {
        return '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=1" />';
    } );

    https://docs.generatepress.com/article/adding-php/

    GP has filter for these things 🙂

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