- This topic has 5 replies, 2 voices, and was last updated 3 years, 12 months ago by
Leo.
-
AuthorPosts
-
April 1, 2019 at 11:24 am #856157
Krystal
Hey guys,
My site is local so I don’t have a link to share with you but I’m trying to hook the secondary menu into the after_entry_header location. Then that menu should display on only one page of my website. I’ve accomplished this but the secondary menu is displaying twice, once in its original location and once where I moved it. When I choose “No Navigation” for the secondary menu in the customizer, my site displays the menu once in the location I moved it to (like it’s supposed to) but then when I view the “live” version of the site both menus are gone.
What I’ve done so far:
– I’ve used the layout element to disable the secondary menu on all pages except the one it’s supposed to be on.
– Added PHP to move the menu where I want it to display using this code://Move secondary nav add_action( 'after_setup_theme','ka_move_secondary_nav' ); function ka_move_secondary_nav() { remove_action( 'generate_after_header', 'generate_add_secondary_navigation_above_header', 7 ); add_action( 'generate_after_entry_header', 'generate_add_secondary_navigation_after_header', 15 ); }
I’m not sure what to do next. Can you possibly point me in the right direction? If it would be possible to have the menu float right in its new location that’d be great as well.
Thanks in advance!
KrystalGeneratePress 2.2.2GP Premium 1.7.8April 1, 2019 at 12:07 pm #856189Leo
StaffCustomer SupportHi there,
Can you try this exact code here and make sure the secondary navigation location is set to below header?
https://generatepress.com/forums/topic/page-header-image-above-menu/#post-288568If not then we will have to see the site live in question.
Let me know ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 1, 2019 at 1:18 pm #856232Krystal
Thanks Leo,
The code you linked makes the menu only display one time but it puts the secondary menu above my main menu instead of below the entry header where I need it. I’ll try to edit the code and see if I can get it to move to where I want it.
KrystalApril 1, 2019 at 1:23 pm #856238Krystal
The navigation is definitely set to below header btw, I forgot to mention that in my reply.
April 1, 2019 at 1:28 pm #856245Krystal
Got it with this code:
//Move secondary nav add_action( 'after_setup_theme','ka_move_secondary_nav' ); function ka_move_secondary_nav() { remove_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 7 ); add_action( 'generate_after_entry_header', 'generate_add_secondary_navigation_after_header', 15 ); }
For some reason I had typed “above” instead of “after” in one of the functions. Once I fixed that it worked fine.
Thanks for your help!
April 1, 2019 at 1:29 pm #856247Leo
StaffCustomer SupportGlad you figured out ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.