- This topic has 6 replies, 2 voices, and was last updated 3 years ago by
David.
-
AuthorPosts
-
January 24, 2020 at 4:50 am #1142399
jhmattern
I’m gearing up to move my three more complex sites over to GeneratePress, and I need to sort out a way to treat single post headers differently before I start the move.
On most of the site, the header will appear as it does on the homepage: https://nakedpr.com — display on page load, and be sticky on scrolling.
But single post pages were designed to be much more minimalist. They need to load with no header at first, like https://nakedpr.com/pitching-bloggers/. Then, on scroll, the header should appear (the same sticky header that would appear when scrolling on regular pages).
Is there any way to do this with GeneratePress?
Thanks!
January 24, 2020 at 8:03 am #1142748David
StaffCustomer SupportHi there,
Enable the Customizer > Layout > Sticky Navigation then this CSS:
body:not(.home) #site-navigation:not(.navigation-stick) { visibility: hidden; height: 0; overflow: hidden; } body:not(.home) #sticky-placeholder { display: none !important; }
Original Doc: https://docs.generatepress.com/article/show-sticky-navigation-only/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 24, 2020 at 8:22 am #1142769jhmattern
Wonderful. Now that I know this can be done, I’ll start switching that site over today and will let you know if I run into any trouble getting this to work.
Thank you!
January 24, 2020 at 9:16 am #1142814David
StaffCustomer SupportYou’re welcome
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/January 25, 2020 at 1:38 am #1143339jhmattern
The site’s in maintenance mode so not visible publicly now, but this code doesn’t work unfortunately.
It’s only showing the header on the homepage. I need every page to show the header normally and only single post pages to hide it until scroll.
Even when it’s hidden though, it’s still leaving the logo there, which I also need hidden — the whole header area on single post pages until they scroll so it’s minimalist and entirely focused on the article.
Any option that might be able to handle this?
January 25, 2020 at 2:58 am #1143380jhmattern
OK. I think I figured it out. If anyone else ever wants to do similar, I changed “.home” to “.page” to make sure the normal header showed on all pages but not posts. And I added .site-logo to the hidden elements.
Thanks for your help!
January 25, 2020 at 5:28 am #1143481David
StaffCustomer SupportGlad to hear you got it resolved 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.