[Resolved] Custom container width for certain post, element not working

Home Forums Support [Resolved] Custom container width for certain post, element not working

Home Forums Support Custom container width for certain post, element not working

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1567066
    Tom

    Sitewide, my container width is 877 (one container, boxes).

    I have a specific blog post I want to make this width 1200 or so. I have added an element, and set it to display on the given post. I have gone and set content area = default and content width = 1200px under content in the element. However the change never happens, the width stays the same. If I change content area in the element (to full width for instance) this change applies. I’ve tried clearing my site and browser cache. What am I missing here?

    #1567608
    Leo
    Staff
    Customer Support

    Hi there,

    Any chance you can link us to the site in question?

    You can use the private information field.

    Let me know 🙂

    #1567859
    Tom

    Sure.

    #1567992
    Leo
    Staff
    Customer Support

    Can you clear and disable your caching plugin first?

    Do you have any other layout elements added?

    #1568035
    Tom

    I have tried clearing Autoptimise and WP Fastest Cache, I can’t disable them on a production site. I don’t think it’s that because other layout element changes work fine.

    No other layout elements are added on the site.

    Could it be that I need to apply the larger container site-wide and then use a layout element to make it smaller on all pages except this one?

    UPDATE: the element works fine as long as the site-wide container is wider than the one defined by the element. But then the top menu bar is far too wide. How can I work around this?

    #1568276
    David
    Staff
    Customer Support

    Hi there,

    you will need to switch the layouts around.
    First set the Customizers container width to the largest width you require.
    Then create a Layout Element that defines the smaller size and where you want that applied.
    The Layout Element may be for the Entire Site and Exclude just the single page you require the wide width.

    #1568831
    Tom

    As I mentioned above, this causes the top bar/logo padding to be set at the wider container site-wide. The all pages layout element only reduces the size of the content container.

    I would like the content container to be wider on a specific page without affecting the size of the logo/top menu container.

    #1568872
    Leo
    Staff
    Customer Support

    Hmm looks like the layout element method only works to make something wider and not narrower – I’ll look into that.

    Give this CSS a shot:

    body.postid-2735 .site.grid-container {
        max-width: 1200px;
    }

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

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