Archived topic
Padding for latests posts vs the rest
9 replies · Started by Igor on August 20, 2021
Hi there,
I set Customizer/Container padding to (10, 10, 0, 10), because I want my Latest posts (=Browse page) & Tags/Categories pages tighter.
But I want evertyhing else to be 30, 20, 20, 40.
If I use this:
.page.separate-containers .inside-article,
.page.one-container .site-content {
padding-top: 30px;
padding-right: 20px;
padding-bottom: 20px;
padding-left: 40px
}
This solves the Pages, but Comments (=About) and single articles/posts are still with the Customizer/Container setting (10, 10, 0, 10).
Can you please help?
Hi Igor,
In your case, I would recommend setting the padding to 30, 20, 20, 40 in the customizer, and use this CSS for blog and archives:
.archive.separate-containers .inside-article, .blog.separate-containers .inside-article {
padding-top: 30px;
padding-right: 20px;
padding-bottom: 20px;
padding-left: 40px
}
Let me know :)
Hi Ying,
it worked (I amended the pixels), but destroyed my other css styling for "browse", I assume I would need to add something?
.blog .post-image img, .archive .post-image img, .search .post-image img {
width: 95%;
height: 155px;
-o-object-fit: cover;
object-fit: cover;
}
.archive.separate-containers .inside-article, .blog.separate-containers .inside-article {
padding-top: 10px;
padding-right: 10px;
padding-bottom: 0px;
padding-left: 10px
}
Hi there,
you may want to create your own Post Content Template for your archives using the Block Element:
https://docs.generatepress.com/article/block-element-content-template/
This way you can control the exact design of the post article for your archives, and leave the padding options in the Customizer to apply to the rest of your site.
Hi David, took me longer than expected.
But somehow I cannot set the background picture to be a link at the same time. In the YT video there is an option and it is mentioned it is for pro users only. I have Premium.
Am I doing something wrong?
Page is https://lindyrecipe.com/browse
Hi Igor,
The pro version means GenerateBlocks Pro not GeneratePress Premium.
https://generateblocks.com/pro/
Hope that's clear :)
Ah, sure, got it, sorry.
Is there any other way for me to make my container link to the post?
Actually in the meantime I solved it with overlaying a transparent button.
It works well with a bit of trial and error.
That's great!
Glad you came out with a way, happy for you :)
That's great!
Glad you came out with a way, happy for you :)
