Archived topic
Side bar only part of the content
7 replies · Started by Matthew on November 20, 2018
Hi there
Is it possible using the GeneratePress page builder to have some blocks full width, some not and have the side bar only next to some sections?
Our current theme allows us to do this and trying to replicate this in GeneratePress. You can see on our current website what I mean if it's not clear in this post.
Thanks for any help you can provide! :)
Hi there,
if it is only the top section then you could use the Header Element which sits above the main content so the sidebar would be below this:
https://docs.generatepress.com/article/header-element-overview/
Adding sidebars to pages with sections:
https://docs.generatepress.com/article/allow-sidebars-sections/
Hi David,
Ah OK that worked, my only issue is now before I was using a "section" above this content to create a line space.
I was using one section to have a grey background then another section to have a white background with the content.
I can't see a way to do this as I can only have one header element I guess on this page?
Is the grey background section the same as the body background? If so we can apply some margin. If not you can use the Hook Element to add some content after the header:
https://docs.generatepress.com/article/hooks-element-overview/
Hey David,
Yes it is. :)
I couldn't see a margin option though within the header element options? Does this need to be done with CSS?
Yeah - if you want to link me to the site i can assist if you need.
SO this:
.page-hero {
margin-bottom: 30px;
}
This effectively adds another 10px to the gap. As this bottom margin overlaps the 20px top margin on the main container, and they cancel each other out. So if the above CSS was only 20px the gap would remain as 20px (not 40px)