Site logo

Archived topic

Disappear Sidebar on Mobile Rotation

9 replies · Started by Pete on October 16, 2021

Viewing posts 1–10 of 10

When a page is loaded on mobile the right sidebar disappears and only the content is displayed.
That is what we want.

However, when we rotate the phone 90 degrees to a horizontal position, the right sidebar appears.
That's not what we want.

We want the sidebar to never appear on mobile, even when we rotate the phone 90 degrees.
How do we do that?

Added via private information...

I don't see a sidebar on the page you've linked.

Is there a specific page I should be looking at?

Sorry about that...

You can try something like this:

@media (max-width: 768px) {
    #right-sidebar {
        display: none;
    }
    .site-content .content-area {
        width: 100%;
    }
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

And adjust/increase the breakpoint of 768px to suit your need.

That helped in that the elements in the sidebar disappeared after setting a high pixel value.
However, the sidebar is still taking up the same space.

We would like the content to instantly fill in the entire screen so that the images are as large as possible.

Could it have something to do with one of the container widths being set to full/contained?

That did the trick!
Thank you!

No problem :)

This archived topic is closed to new replies.