- This topic has 27 replies, 8 voices, and was last updated 7 years, 7 months ago by
David.
-
AuthorPosts
-
September 12, 2017 at 1:46 pm #384176
Alex
I had to put that in there temporarily because the mobile menu was messing with the vertical center alignment property in the header. That wasn’t the issue if you disable that CSS then the issue persists.
Sorry for the confusion.
September 12, 2017 at 4:30 pm #384264Leo
StaffCustomer SupportLittle confused what the issue is currently? You are trying to hide one of the menus?
September 12, 2017 at 4:46 pm #384272Alex
I have 2 navigations:
Primary: Used for Restaurant Menus page
Secondary: Used for All Pages (this is my main navigation)I’m using the Primary nav on the Restaurant Menu page because it allows me to stick it for the abnormally long page.
I only want the Primary nav to be on the Restaurant Menu page because it is only applicable to the Restaurant Menu page. It lists the various Menus (i.e. Lunch, Dinner, etc.) via anchors. If you were to see this navigation on the About page (1) it wouldn’t make sense and (2) the links won’t work because the anchors wouldn’t be on the About page
So I disabled the Primary nav on all pages BUT the Restaurant Menu page. Works perfectly EXCEPT when in mobile view, the Primary nav still shows on all the other pages. Not only that, but it messes with the vertical alignment of my page headers.
For the time being, I disabled the Primary nav completely with the CSS you mentioned above. But if you remove that style, you can see what is going on.
*Edit: I think I fixed the “messing with vertical alignment” problem with the page headers. But the issue of the mobile nav appearing still exists.
September 12, 2017 at 8:22 pm #384321Leo
StaffCustomer SupportSo you want to show only the Primary Nav (Menu) on the Menu page on mobile? But then people wouldn’t be able to navigate to other pages?
September 12, 2017 at 8:30 pm #384326Alex
Not quite. I want to show the Primary Nav always (Desktop and Mobile) on the Restaurant Menu page. I want to show the Primary Nav never (neither Desktop nor Mobile) on all other pages.
September 12, 2017 at 9:42 pm #384351Leo
StaffCustomer SupportHmm can you try disabling the mobile header feature? https://docs.generatepress.com/article/mobile-header/
September 12, 2017 at 10:14 pm #384371Alex
Wow… it was that simple.
That worked. Not really sure why but hey I can finally move on to the next problem. Thanks for your help Leo!
September 12, 2017 at 10:27 pm #384372Leo
StaffCustomer SupportNo problem! Not an easy one to see 🙂
March 2, 2018 at 6:54 am #509743Dan
Nice work on the site Alex
September 9, 2018 at 6:18 pm #672840David
Hey Tom,
Did you ever include the feature to have two menus sticky?
Thanks 🙂
September 10, 2018 at 4:49 am #673123David
StaffCustomer SupportHi there,
there is not an built function for sticking both navs. We can help with some CSS, if you need to please raise a new topic 🙂
September 10, 2018 at 5:20 am #673138rex wickham
Hi
That is what this thread is supposed to be about. The original posted said “I just want to have 2 menus sticky.”September 10, 2018 at 6:25 am #673193David
StaffCustomer SupportThere are a couple of options, we can for-go the GP Sticky navigation, and use the
stickyCSS property on both navs.Or we could use a snippet like so, which removes a before header secondary navigation and hooks it inside the primary nav, which will make both sticky:
add_action( 'after_setup_theme', 'lh_move_secondary_nav' ); function lh_move_secondary_nav() { remove_action( 'generate_before_header', 'generate_add_secondary_navigation_before_header', 7 ); add_action( 'generate_inside_navigation', 'generate_add_secondary_navigation_before_header', 7 ); }In both instances this would require site specific CSS to format and style. But nothing too complicated.
-
AuthorPosts
- You must be logged in to reply to this topic.