Archived topic
Max-Width for Pages with No Sidebar EXCEPT the Homepage
7 replies · Started by litesprint on January 20, 2023
Hi,
My site's homepage is designed using Thrive Architect, so I need it to be full-width. However, I also need other pages (non Thrive Architect) to be limited to a max width of 800px when there's no sidebar.
I was using this CSS:
.no-sidebar .type-page .site-content {
max-width: 800px;
margin-left: auto;
margin-right: auto;
}
Ideally, I'd want two different settings for 'full width' and 'contained' pages in the post editor (I think older versions of GP used to have a similar option), so that I can select the one I want on a page-by-page basis rather than using universal CSS.
Can this be done?
Hi there,
you can set the Content Container to Full Width in the post editor:
https://docs.generatepress.com/article/content-container/
you can also use the Layout Element to do the same thing but apply the options using Display Rules:
https://docs.generatepress.com/article/layout-element-overview/
Let me know if that works for you
Content Container is already set to Full Width for the homepage. Even after that, whenever I use that custom CSS, the homepage also gets shrunk.
I came up with this code and it worked without affecting the homepage:
.contained-content.no-sidebar .type-page .entry-content {max-width: 1000px !important; margin-left: auto; margin-right: auto;}
But there should really be a simpler implementation for something as basic as this. I see many other themes having similar options.
How do you determine which pages have no Sidebar ?
I manually disable the sidebar for those pages using post editor options.
We don't have a Layout option that can set the Width based on the sidebar setup. The Layout Element dose allow you to set if for other display rules. So for now the CSS method is the best way to go.