Archived topic
Create a full width post header when using a boxed layout
5 replies · Started by Daniel on October 17, 2022
Hi there!
I have a 1200px wide design with 40px margins on each side.
For the single post layout I want to create a header containing the title, meta and date. This header I want to take up the 1200px width.
I tried to create a content template but when using it in single post, the header does not go all the way to the sides as it respects the 40px margins on each side.
I changed the method and have opted to use a hook (inside_site_container) for the header of each post. With this I get the width I want but in the content of the post the title and meta are shown in addition to the ones I have added to my custom header.
With the GP hide elements option I can only act on the title, not the meta.
I need advice about the best way to proceed: do I use the content template and add a -40px margin to the header to make it reach the ends? is it better to use the hook option and then hide the title and meta with some snippet? any other suggestions?
Thanks!
Hi Daniel,
For reference, can you share the link to the page in question?
You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Hi Fernando!
It's a site I'm working on at the moment, you'll have to use https://www.skipdns.link/ with the IP that I provide you.
In the example you will see my custom header in red, made using the hook inside_site_container, and then the original header of the post.
To clarify, have you tried using a Block Element - Page Hero? Reference: https://docs.generatepress.com/article/block-element-page-hero/
You should be able to create such a section that's full width or contained to 1200px depending on your Container Block settings.
Let us know.
Perfect!
That's the exact option I needed.
Thanks!
You're welcome Daniel!