[Support request] Set global container withs to be different with pages that have sidebar

Home Forums Support [Support request] Set global container withs to be different with pages that have sidebar

Home Forums Support Set global container withs to be different with pages that have sidebar

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2336517
    Josh

    Is there a way to do this? I’d like the container with to be 900 if there is no sidebar but container width to be 1200 so that the side bar will be 300 and page content will be 900.

    #2336527
    Fernando
    Customer Support

    Hi Josh,

    You can create a Layout Element, and set it to display on the specific pages with a sidebar.

    Reference: https://docs.generatepress.com/article/layout-element-overview/

    #2337284
    Josh

    Hey Fernando! Thanks for helping! That doesn’t work though. it still gets overwritten:

    .grid-container { (from inline:2)
    max-width: 892px;
    }
    .grid-container { (from main.min.css:1)
    margin-left: auto;
    margin-right: auto;
    max-width: 1200px;
    }

    It looks like because the customizer puts it inline it’s overwriting what the layout element creates. I’ve posted a link to the page in the private info.

    #2337495
    Fernando
    Customer Support

    Try setting 1200px in the Customizer and 900px in the Layout Element.

    #2337570
    Josh

    Isn’t that more of a bandaid to the issue? It feels backwards, and not sure it would make any difference if the customizer is pulling rank. Is there a hook to use? I guess I could just use css too?

    .page-id-xxx.grid-container { (from main.min.css:1)
    max-width: 1200px!important;
    }

    but I dislike having to force the css that way.

    #2337584
    Fernando
    Customer Support

    Actually, can you try setting the Content Area of your Layout Element to Full width and then set the Content width to 1200px?

    Let us know how it goes.

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