- This topic has 5 replies, 2 voices, and was last updated 5 years ago by Tom.
November 16, 2016 at 2:24 am #244757John
I have applied the code to fix the header you provided below and it works fine. My problem is that my primary navigation (below header) disappears when I add the css. I want to have a sticky header and the primary menu navigation still appear. When you scroll down, I only want the header to remain fixed, the menu can go away.
Thanks for your help!November 16, 2016 at 9:23 am #244863TomLead DeveloperLead Developer
If your navigation isn’t inside the header, you would have to do this: https://generatepress.com/forums/topic/how-can-i-create-a-fixed-header-and-top-menu-in-the-generate-press-theme/#post-31579November 16, 2016 at 10:06 am #244889John
It appears that when you create the static header that the menu gets pushed to the very top of the page causing it to be hidden beneath the header.
I don’t know if it is the right way, but I was able to get it back using the following code:
}November 16, 2016 at 1:42 pm #244946TomLead DeveloperLead Developer
The best way to do it is to scrap that CSS and use the method I explain here: https://generatepress.com/forums/topic/how-can-i-create-a-fixed-header-and-top-menu-in-the-generate-press-theme/#post-31579
That way your header/navigation won’t conflict.November 17, 2016 at 2:08 am #245082John
Thanks again for the help.
I have GP Premium and use a child theme.
I removed my css and used yours. Instead of using hooks, I hard coded it into the header.php file in my child theme (easier for me to remember that way).
Everything works now!November 17, 2016 at 8:51 am #245195
- You must be logged in to reply to this topic.