Site logo

[Support request] Max-Width for Pages with No Sidebar EXCEPT the Homepage

Home Forums Support [Support request] Max-Width for Pages with No Sidebar EXCEPT the Homepage

Home Forums Support Max-Width for Pages with No Sidebar EXCEPT the Homepage

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2503627
    litesprint

    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?

    #2503783
    David
    Staff
    Customer Support

    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

    #2503805
    litesprint

    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.

    #2503811
    litesprint

    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;}

    #2503813
    litesprint

    But there should really be a simpler implementation for something as basic as this. I see many other themes having similar options.

    #2503831
    David
    Staff
    Customer Support

    How do you determine which pages have no Sidebar ?

    #2503833
    litesprint

    I manually disable the sidebar for those pages using post editor options.

    #2504604
    David
    Staff
    Customer Support

    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.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.