Archived topic
Move Secondary Nav
7 replies · Started by Gabriele on February 18, 2018
Hi,
I'm trying to move the secondary nav below the page headers that I created with Gp.
After a look in the forum for answers I tried this but didn't work:
add_action( 'after_setup_theme','tu_move_secondary_nav' );
function tu_move_secondary_nav() {
remove_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 7 );
add_action( 'generate_before_main_content', 'generate_add_secondary_navigation_after_header', 15 );
}
Please can you help me?
Is it possible also to move the search widget in the secondary nav? This will work?
https://generatepress.com/forums/topic/move-search-function-to-secondary-menu-position/#post-333155
Hi there,
Can you make sure the secondary navigation is set to below header in the customizer?
Then the code should work. If not please link us to the page.
Yup that solution should work :)
Hi,
I managed to do it: there was a problem with GeneratePress Extender plugin, so I put the code in the function.php file on my child theme.
But for a better mobile experience I have to exchange primary and secondary navigation, so now secondary navigation is set to float right on the header and primary navigation is set below the header: so I must do the same moving nav thing on the primary nav insted of secondary nav.
How to move the primary nav from below the header to after page headers (or before content if it is a better solution)?
Perfect, thanks a lot Leo! Now the difficult part: how can I hide a primary nav menu item and show it only on sticky menu?
I imagine I could give a custom css class to the menu item and conditionally hide it unless sticky but I am a bit loss... are you able to give me an example of syntax in order to have some inspiration?
See a similar example here: https://generatepress.com/forums/topic/center-sticky-nav-logo/#post-443357
Can you open a new topic if you can't figure out?
Thanks!
Thanks again Leo, I succeeded :)
No problem!