- This topic has 5 replies, 2 voices, and was last updated 5 years ago by Andrew Misplon.
- AuthorPosts
- October 5, 2019 at 9:12 pm #13219
JonasParticipantI’m a very happy user of the Polestar theme. I was wondering if you could advice me on what code to apply in order to make the top menu / header disappear on scroll down and re-appear on scroll up. (Sort of a mix between the sticky and non-sticky options currently available in the theme).
Thanks a lot!
October 6, 2019 at 12:26 pm #13221
Andrew MisplonKeymasterHi 🙂
Thanks for your question and feedback.
This would need to be done using JavaScript. I’ll take a look and come back to you during the week, hopefully with a solution.
Chat further then.
October 8, 2019 at 9:31 am #13228
Andrew MisplonKeymasterHi again
You can try the following snippet. Right click and save as to download the file to your desktop. To make use of the file, got to Plugins > Add New, search for and install a plugin called Code Snippets. Once activated, go to Snippets > Import to import this file. Ensure the snippet is set to run on the site front-end, save and activate.
This snippet isn’t perfect, it currently isn’t offset for the WordPress admin toolbar and doesn’t currently work well with the Polestar one page scrolling functionality. Whether or not this is a problem will depend on how you’re using Polestar.
Let me know how it goes. Thanks.
October 8, 2019 at 3:19 pm #13229
Andrew MisplonKeymasterWhen trying this snippet out it’s best to deactivate the theme’s Sticky Header setting at Customize > Theme Settings > Header.
Thanks
October 8, 2019 at 6:36 pm #13230
JonasParticipantHi Andrew,
It works! Thank you so much for your work and your quick replies. You’re right, it’s not offset for the admin toolbar, but from a user perspective it works really well. It would be great if you could include this option in a future update of the Polestar theme. (And perhaps even include the option to use it on smaller screens only). Thank you so much for your time and please let me know if you decide to develop this function further (which I hope you will).
Thanks!
October 9, 2019 at 4:52 pm #13234
Andrew MisplonKeymasterSuper, glad to hear that helps.
Thanks for your feedback. If I’m able to develop this further into a theme setting, I’ll certainly keep you updated.
Cheers for now 🙂
- AuthorPosts
You must be logged in to reply to this topic.