Hi,
I’d like to change the viewport metadata to remove the viewport zoom limitation of 1.
My products have quite detailed parts, and not being able to pinch and zoom on a mobile device is quite frustrating.
The atelier theme overrides the default swift viewport code with the following line:
function sf_atelier_viewport_content() {
return "width=device-width, initial-scale=1.0, maximum-scale=1"; //maximum-scale=1 added here.
}
add_filter('sf_viewport_content', 'sf_atelier_viewport_content');
The last section ‘maximum-scale=1’, is what is causing the pages to not be zoomable on mobile.
In theory I should be able to fix this by adding my own filter in functions.php to return a new value.
like this:
function sf_atelier_child_viewport_content() {
return "width=device-width, initial-scale=1.0";
}
add_filter('sf_viewport_content', 'sf_atelier_child_viewport_content', 10);
my function doesn’t seem to override the atelier one however, so I’m still getting the zoom.
Would be grateful if somebody could help with this.
Thanks,
-Barry