Archived topic
Reduce space between header and content on single post pages (on MOBILE only)
9 replies · Started by Michelle on October 15, 2021
How do I reduce the gap between the header and content on mobile? My archive, author, category, and single post pages have a gap and I can't find a place to close this padding without it also affecting other pages on my desktop and tablet sites.
Hi Michelle,
Any chance you can link us to the site in question?
You can use the private information field.
https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Let me know :)
Here is my link:
Hi there,
theres an empty Paragraph block above the GB Grid Wrapper.
WP in a recent updated decided that empty paragraphs should be output on the front end - doh!
Ideally you would want to delete any empty text blocks wether that be in your post content or a block element ( select it and backspace delete ).
Or you can add this CSS to stop them occupying any space.
p:empty {
display: none;
}
I added the code, but did not see a difference in the padding on mobile between the title and content. The issue is only on single post pages, author, archive, and category pages which use native Wordpress rather than WP Show Posts Pro.
Hi Michelle,
You have this CSS which adds 50px top margin to the single post content:
https://www.screencast.com/t/GOpC4f7SoM
Can you try remove it of reduce the value?
I could do that, except I like the padding on the Single Post pages for desktop and tablet sites. It's the MOBILE only that I'd like to change...
OK, then try this CSS:
@media (max-width: 768px) {
.single-post header.entry-header {
margin-top: 10px;
}
}
That's so much better. What an improvement!
Glad to hear that :)