[Resolved] Mobile Zoom

Home Forums Support [Resolved] Mobile Zoom

Home Forums Support Mobile Zoom

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #239580
    Mark

    Hi Tom,

    I’m looking to stop mobile zooming on my website: http://www.fastbus.ie

    The normal meta viewport tag doesn’t seem to be working and I can’t for the life of me find how to turn it off.

    <meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0″/>

    Any help appreciated!

    Cheers,
    Mark

    #239648
    Tom
    Lead Developer
    Lead Developer

    You can remove the current meta tag like this:

    add_action( 'after_setup_theme','tu_remove_viewport_meta' );
    function tu_remove_viewport_meta()
    {
        remove_action('wp_head','generate_add_viewport');
    }

    Then you can add your own in a function or GP Hooks ๐Ÿ™‚

    #240704
    Mark

    Cheers thanks for that Tom.

    #240816
    Tom
    Lead Developer
    Lead Developer

    No problem ๐Ÿ™‚

    #251545
    Ahamed

    Hi,

    To just turn off the mobile zoom so that it is not scalable,

    What css should I add?

    #251632
    Tom
    Lead Developer
    Lead Developer

    You could do this:

    add_filter( 'generate_meta_viewport', 'tu_disable_mobile_zoom' );
    function tu_disable_mobile_zoom() {
        return '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">';
    }
    #360793
    German

    Hello,
    As I can disable the pinch zoom on the mobile, I do not understand how to do it in the hooks.
    thank you very much for your help

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