Archived topic
How to change layout of only one post?
9 replies · Started by Harshit on November 21, 2018
Hi, I want to change layout for only one post and make it look like this https://ketobootstrap.com/keto-shopping-list
How can i do that?
Hi there,
you can remove the side bar for a single post using the Disable Elements or Layout Element module in GP.
https://docs.generatepress.com/article/disable-elements-overview/
The content would require HTML or some plugins to create the layout of rows and columns.
Alternatively you can use GP Sections on a post. They remove the sidebar by default as it is a simple pagebuilder, that will allow you to create rows.
Columns can be added simply using a plugin like Lightweight Grid Columns (one of Toms) or Gridable. Both are in the WP repository.
Ok, I used HTML and CSS to achieve the layout but the problem is comment pox and share buttons are all over content when scrolling down. Don't know what I did wrong. Here's the link to post where I did the changes.
Oh, it's resolved. I had added a height parameter which was causing the issue. On removing that, it's back to normal.
The fixed height on this CSS is causing the problem:
.column {
float: left;
width: 33.33%;
padding: 10px;
height: 300px; /* Fixed height */
}
Use min-height or leave it as auto.
Awesome - bit of lag there between replies :) Glad you got it resolved.
Yeah, thanks for the reply though. Is it fine if I add css to specific post using elements? I mean there won't be any issue, right? I have added in wp_head.
No issues there. You can also use Tom's Simple CSS plugin which provides a CSS Meta box in the post editor for the same result.
Oh, thanks for the plugin recommendation. Will be quite handy in future.
You're welcome :)