Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. disable mobile rotation / show notification when phone is landscape

disable mobile rotation / show notification when phone is landscape

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 595 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Toby
    wrote on last edited by arminunruh
    #1

    Hi

    Is there a way to stop mobile rotation / lock screen?

    Cheers
    Toby

    1 Reply Last reply
    1
    • arminunruhA Offline
      arminunruhA Offline
      arminunruh
      Global Moderator
      wrote on last edited by
      #2

      no there isn't :/

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zochovsky
        wrote on last edited by
        #3

        It would be great if this feature could be added.

        1 Reply Last reply
        0
        • arminunruhA Offline
          arminunruhA Offline
          arminunruh
          Global Moderator
          wrote on last edited by
          #4

          there is no way to do this!

          you can probably show a warning using custom css & custom html that shows up when the phone is in landscape mode using a combination of media queries and html classes

          like
          https://stackoverflow.com/questions/66044959/how-do-i-show-something-only-if-the-device-is-portrait-with-html-css

          and

          body.is-touchdevice

          body has a class of "is-touchdevice" when ure on a phone

          1 Reply Last reply
          0
          • arminunruhA Offline
            arminunruhA Offline
            arminunruh
            Global Moderator
            wrote on last edited by
            #5

            ok heres an example:

            custom html at bottom:

            <div class="rotate-notification">
            <div class="rotate-text _Default_no_spaces">Please rotate your phone</div>
            </div>
            

            custom css:

            .rotate-notification{
            display:none;
            z-index: 999999;
            background-color: black;
            width: 100%;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            }
            
            .rotate-text{
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white!important;
            }
            
            @media (orientation: landscape) and (max-width: 1024px){
            body.is-touchdevice .rotate-notification{
            display: block;
            }
            }
            

            haven't tested it :D

            1 Reply Last reply
            0
            • arminunruhA Offline
              arminunruhA Offline
              arminunruh
              Global Moderator
              wrote on last edited by
              #6

              instead of doing this you could also do:

              in
              lay options → Phone Breakpoint

              you can set this to a higher value, so the phone version would still show up on landscape mode, instead of the desktop version

              maybe that looks good enough then

              1 Reply Last reply
              0
              • arminunruhA Offline
                arminunruhA Offline
                arminunruh
                Global Moderator
                wrote on last edited by
                #7

                Or if you want an image:

                <div class="rotate-notification">
                <img src="https://media.istockphoto.com/id/1144546554/vector/rotating-phone-from-vertical-to-horizontal-position-phone-vector-icon.jpg?s=612x612&w=0&k=20&c=dnBtqmZ7_8Cjk2UubtE_o1gDkaIMvs1kStk45tzmEiY=">
                </div>
                

                css:

                .rotate-notification{
                display:none;
                z-index: 999999;
                background-color: black;
                width: 100%;
                height: 100vh;
                position: fixed;
                top: 0;
                left: 0;
                }
                
                .rotate-notification img{
                position: fixed;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                width: 150px;
                }
                
                @media (orientation: landscape) and (max-width: 1024px){
                body.is-touchdevice .rotate-notification{
                display: block;
                }
                }
                
                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                I also code custom websites or custom Lay features.
                šŸ’æ Email me here: šŸ’æ
                info@laytheme.com

                Before you post:
                1. When using a WordPress Cache plugin, disable it or clear your cache.
                2. Update Lay Theme and all Lay Theme Addons
                3. Disable all Plugins
                4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                This often solves issues you might run into

                When you post:
                1. Post a link to where the problem is
                2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                Online Users
                A
                alasdair17
                Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                laytheme.com
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • Users
                • Search