Archived topic
Anchor-based sticky menu (w. highlight of item in viewport) on sub-pages
3 replies · Started by TheSalvadorDaliOfWebsites on April 18, 2021
Dear GP team,
I can't quite wrap my head around this so I hope you can point me in the right direction.
My website started as a simple one-page scrolling website with sticky menu with highlighting of the section currently in the viewport, based on anchor links to the same page, eg. #topsection
Since I started adding some sub-pages and blogposts the top sticky menu (of course) doesn't work on the subpages, the anchor links not containing the full URL. First thing I tried was to add the full URL to the menu points, eg. behandlernet.com/#topsection
This works but it screws up the highlighting of active section in viewport on the main page. Everything is highlighted all the time, obviously, cause you're allways on the entire page. Makes sense. For now I reverted to using relative anchor links without the full URL.
How can I get both active menu highlighting on the mainpage and make the sticky menu work on subpages as well?
I am using the 'Page scroll to ID'-plugin and GP Premium but reading several threads on this forum has given me the impression it is possible now with GeneratePress alone to create a sticky menu with active section highlighting in the menu. Am I right?
A big fan of your product and recommend often to others.
Hi there,
its not something that GP can do natively - but the Page Scroll to ID plugin should be able to handle that for you.
Heres part of their docs on dealing with linking from other pages:
http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-scroll-to-different-pages
Might be worth asking their support how to manage the 'same base url' link styling.
Man, this is customer service way beyond the beyond, diving into plugin documentation. Thank you.
Glad to be of help!