• I have created a mobile theme on WordPress and added the header code:

    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />

    I tested it on my smartphone and worked good. However when I rotated the screen, it didn’t stretch out the entire website.

    How do I make the theme stretch out on rotating the screen on your smartphone.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’ve gotten it to work before with something similar to your <meta> tag and some js.

    <script>
        var metas = document.getElementsByTagName('meta');
        var i;
        if (navigator.userAgent.match(/iPhone/i)) {
          for (i=0; i<metas.length; i++) {
            if (metas[i].name == "viewport") {
              metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
            }
          }
          document.addEventListener("gesturestart", gestureStart, false);
        }
        function gestureStart() {
          for (i=0; i<metas.length; i++) {
            if (metas[i].name == "viewport") {
              metas[i].content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
            }
          }
        }
      </script>

    There are plenty of other methods scattered around stackoverflow as well.

    Thread Starter secretsau

    (@secretsau)

    Thanks buddy..

    But that just makes the website zoom in and out.

    Is there a way to force the website on the mobile browser not to rotate when you turn the smartphone ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need help fixing a mobile theme’ is closed to new replies.