Site logo

Archived topic

Meta Viewport not Working

1 reply · Started by Sai C.N.G Blackbyrn on November 26, 2020

Viewing posts 1–2 of 2

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/

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 :)

This archived topic is closed to new replies.