Archived topic
Different padding for specific blog category
10 replies · Started by jisu on January 4, 2023
Hi,
I have set up padding (left, right) for a single post, and this setting affects posts in different blog categories.
Is it possible to have different padding set up for specific blog categories?
Thanks,
Hi there,
it is possible with some CSS. First a question - are you adding padding to change the width of the post ?
actually, I want to erase padding for my new blog category. Then I want to add padding in a container.
You can use a Layout Element:
https://docs.generatepress.com/article/layout-element-overview/
On the Content tab, you can set the Container Area to Full Width or Contained to remove the themes padding.
Then just set the Display Rules for the locations you want it applied eg. Post Category -> Your Category Term
Hi,
I have already set up in layout in element. I think the padding is in the code.
@media (max-width: 768px)
.single-post #content {
padding: 30px 20px;
}
I think the padding is in the code. Is there a way to exclude specific blog category?
Can i see a post i the category you want to remove the padding from ?
Here is the link to the post
So this CSS:
@media (max-width: 768px) {
.single-post #content {
padding: 30px 20px;
}
}
is in the Customizer > Additional CSS. You can just delete that.
This is code for my main blog content.
If I erase this code, my main blog content no longer have padding.
i just want my new category dont affect that code.
is there a way to set up padding for main blog content? without using that code?
The blog, and any page post or archive that has not had a Full Width/Contained Layout element applied to it will get its padding from the Customizer > Layout > Container -> Padding, theres an option for Desktop and Mobile