# Locking Android orientation to portrait?

**URL:** https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872
**Category:** Feature
**Created:** [July 20, 2018, 7:24pm UTC](https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872 "2018-07-20T19:24:56Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Garrick](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Garrick](https://meta.discourse.org/u/Garrick)
#### Post date: [July 20, 2018, 7:24pm UTC](https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872/1 "2018-07-20T19:24:56Z")

</div>

Thanks. I have my test site thats already updated. When I view it from chrome mobile my regular site is locked vertical (how my phone is setup) but the updated test site changes direction to horizontal when I turn on the phone. Is there a setting for this? Its not a chrome issue as both are thru chrome. Its a pain to have it turn when I want to view it while laying down.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [July 20, 2018, 8:05pm UTC](https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872/2 "2018-07-20T20:05:49Z")

</div>

Nope there is not a site setting for this, as you can see here

> <https://github.com/discourse/discourse/blob/main/app/controllers/metadata_controller.rb>

orientation is set to ‘any’.

---

<div class="post-metadata">

### Author: ![Garrick](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Garrick](https://meta.discourse.org/u/Garrick)
#### Post date: [July 21, 2018, 8:57pm UTC](https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872/3 "2018-07-21T20:57:12Z")

</div>

Is there anyway to edit this everytime I need to update? Doesnt make any sense to have horizontal view when the mobile design is how it is. You cant see anything and I dont want to use it with this cause its annoying to keep the phone from switching constantly.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 22, 2018, 7:31am UTC](https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872/4 "2018-07-22T07:31:17Z")

</div>

Why is the device switching constantly? Hold it in vertical (portrait) mode if you want portrait.

---

<div class="post-metadata">

### Author: ![Garrick](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Garrick](https://meta.discourse.org/u/Garrick)
#### Post date: [July 22, 2018, 12:27pm UTC](https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872/5 "2018-07-22T12:27:49Z")

</div>

Because like most people I browse my phone while laying down on the couch or doing other things. I dont want to play games with the browser setting, If I wanted horizontal I would allow my phone the option of going horizontal. Setting a site to all doesnt allow this to lock on portrait.

Its really annoying that I wont even go on my own forum because I cant browse it properly when laying down. I dont just stay on my forum from 9-5 at a desk. For the sake of community interaction I think it would be nice to have the feature to lock it to portrait or give us a way to do that

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [July 22, 2018, 1:20pm UTC](https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872/6 "2018-07-22T13:20:29Z")

</div>

Have you tried this as a theme component?

> **[Orientation Lock | CSS-Tricks](https://css-tricks.com/snippets/css/orientation-lock/)**
>
> Sent in by Andreas Gotfredsen.

---

<div class="post-metadata">

### Author: ![Garrick](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Garrick](https://meta.discourse.org/u/Garrick)
#### Post date: [July 22, 2018, 1:27pm UTC](https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872/7 "2018-07-22T13:27:34Z")

</div>

Thanks. Just tried it. Doesnt work.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [July 22, 2018, 2:56pm UTC](https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872/8 "2018-07-22T14:56:40Z")

</div>

I have never seen that. I lock my phone vertical and have never seen a Discourse site not display the way that I expect when I have phone sideways when I am lying down (which it seems only you and I do).

Have you got some theme on your site that’s breaking that somehow? Have you tried [safe mode](https://meta.discourse.org/t/53504?silent=true)?

---

<div class="post-metadata">

### Author: ![Garrick](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Garrick](https://meta.discourse.org/u/Garrick)
#### Post date: [July 22, 2018, 3:00pm UTC](https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872/9 "2018-07-22T15:00:02Z")

</div>

No theme breaking it. I have 2 forums up right now and a test one. Only the updated 2 do this. One of them was a mirror I use Digital Ocean to restore from a snapshot of my older one. Then I updated the new one. The old one still stays vertical if my phone is locked vertical.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 22, 2018, 4:45pm UTC](https://meta.discourse.org/t/locking-android-orientation-to-portrait/92872/10 "2018-07-22T16:45:18Z")

</div>

We used to lock rotation when you used the Add to Home screen on Android and got complaints from users.

So we don’t do that anymore. If you want to lock rotation use the OS option on the quick settings tile.
