Archived topic
Remove navigation from certain pages
5 replies · Started by Jamal on January 5, 2017
Hello good people
How can i remove main menu from certain pages using php? I have my navigation set to float right and i would like to hide the navigation and instead show breadcrumbs on certain pages using inside_navigation_hook
CSS is the easiest way, but I assume you're not wanting them.
The generate_navigation_location filter is what you're looking for: https://docs.generatepress.com/article/navigation-location/
Perfect ! Much much appreciated.
My site is one pager and this came in handy as i need to show my navigation only on the front page, the other pages like cpt will show the breadcrumbs because the one pager navigation was serving no purpose on those pages.
Now that i have removed the navigation on those pages, the sticky navigation is gone as well. Any way to have like a sticky navigation but with my breadcrumbs instead?
You would have to apply position:fixed to the breadcrumb element I believe.
Which sticky effect are you using?
I have tried with both sticky effects and even none, but it doesn't show up. Not much of a deal anyway, those pages won't be very long.
The breadcrumb is in the before_header_content hook so if need arise i will explore how to make site header sticky.
Thanks very much !
No problem! :)