[Resolved] Different separate spacing in different pages

Home Forums Support [Resolved] Different separate spacing in different pages

Home Forums Support Different separate spacing in different pages

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #409768
    Alberto

    Hello.
    This is about the Separate Spacing parameter at Customizing -> Layout -> Container.
    I setup to 0 because I want no spacing in certain pages, but I want a top padding, for example 40px, in other pages.
    Is there any hook or filter I can use to achieve this goal?

    Thanks.

    #410016
    Leo
    Staff
    Customer Support

    Hi there,

    If you use Tom’s Simple CSS plugin, it gives you a CSS metabox for each page:
    https://docs.generatepress.com/article/adding-css/#simple-css

    Then on the page where you want 40px top padding, try this:

    .site-content {
        margin-top: 40px;
    }
    #410139
    Alberto

    Hello Leo.
    Thanks for your reply!
    Is there a way not using a plugin or even CSS?, Maybe using any hook or filter?

    Regards.

    #410257
    Leo
    Staff
    Customer Support

    Tom’s plugin with CSS is the easiest way. Simple CSS is not necessary though you can just add .page-id-xx in front of the CSS above to make it page specific.

    One other option you can consider is to set the padding to something you want normally, then use page builder container to remove padding on pages you don’t want padding: https://docs.generatepress.com/article/page-builder-container/

    #410457
    Alberto

    Hi Leo!
    Page Builder Container is sure the best choice for me, it works perfectly!

    Thank you very much!

    #410704
    Leo
    Staff
    Customer Support

    No problem!

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