Archived topic
Full (container) width related posts
7 replies · Started by Bright Idiots on September 16, 2022
After creating a related post element (with GB) I would like to display this full width after the content, before the commment section. This displays in the 'content container', so it's not full width. How can I display the related posts full width?
I'm using the hook: before content container
Also I centered the content with some CSS I found on the forum
@media(min-width: 1024px) {
.single-post .site-content {
display: flex;
}
.single-post .site-content:before {
content: '';
display: block;
width: 25%; /* Set value to width of right sidebar */
}
.single-post #primary,
.single-post #right-sidebar {
float: none;
left: unset;
}
}
Hi there,
You would need to:
1. use the before_footer hook, as this is Full Width. And set the Hook Priority to 5
2. move the Comments below that by adding the PHP Snippet that Tom provides here:
https://generatepress.com/forums/topic/move-comments-section-before-the-footer/#post-1663535
Adding PHP explained: https://docs.generatepress.com/article/adding-php/
Thanks for your quick reply!
The related posts is full width now, but the comment section below as well. Can I make this the regular width again?
Can i see a post on your site ? As it requires a little CSS.
Sure, see the private info!
Try this CSS:
#comments {
max-width: 800px;
margin: auto;
padding-bottom: 120px;
}
I added some bottom padding too, to stop the footer from overlapping the form.
This works, thanks:-)
Glad to hear that!