May 1, 2014 at 2:44 pm #103229
I have set my primary menu in a widget in header right as per the demo
I would like to use the secondary menu above the header. I am using the recommended code which has worked fine for me with other themes:
//* Reposition the secondary navigation menu remove_action( 'genesis_after_header', 'genesis_do_subnav' ); add_action( 'genesis_before_header', 'genesis_do_subnav' );
Sadly, as you can see from this screenshot this does not seem to be working; the “contact” and “français” should be above the header. Any ideas?May 1, 2014 at 4:10 pm #103239
Lauren @ OnceCoupledMemberPost count: 512May 1, 2014 at 8:16 pm #103265
The fixed position was my first thought as well, but the HTML is not displaying in the order I would expect from the code I used to reposition the menus.
Here’s what comes out:
<header class="site-header" role="banner" itemscope="itemscope" itemtype="http://schema.org/WPHeader"> <div class="wrap"> <div class="title-area">title stuff here</div> <aside class="widget-area header-widget-area"> <section id="nav_menu-2" class="widget widget_nav_menu"> <div class="widget-wrap"> <nav class="nav-header" role="navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> <ul id="menu-navigation" class="menu genesis-nav-menu"> Main nav items all listes here </ul> </nav> </div> </section> </aside> </div> </header> <div class="site-container"> <nav class="nav-secondary" role="navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> <div class="wrap"> <ul id="menu-toolbar" class="menu genesis-nav-menu menu-secondary"> Secondary nav items listed in here </ul> </div> </nav> <div class="site-inner"> ETC...
As you can see the secondary nav does not get bumped up above the header as I would expect. I downloaded a fresh copy of the theme with demo content to rule out any other customizations errors I may have made, but I get the same result.May 2, 2014 at 6:56 am #103311
I’ve gone ahead and also removed all CSS which affects positioning. No dice; the html is still still the issue here.
remove_actionworks just fine. It’s the
add_actionwhich does not seem to be doing anything. Would love any other ideas on this.May 5, 2014 at 6:46 am #103691
Ok, fixed. In case this helps anyone else I will share that I overlooked the priorities used in this theme for the menu positioning:
//* Reposition the header
remove_action( ‘genesis_header’, ‘genesis_header_markup_open’, 5 );
remove_action( ‘genesis_header’, ‘genesis_do_header’ );
remove_action( ‘genesis_header’, ‘genesis_header_markup_close’, 15 );
add_action( ‘genesis_before’, ‘genesis_header_markup_open’, 5 );
add_action( ‘genesis_before’, ‘genesis_do_header’, 10 );
add_action( ‘genesis_before’, ‘genesis_header_markup_close’, 15 );
I just needed to add a higher priority to the secondary navigation menu to make it appear above the header.June 17, 2014 at 3:12 pm #110264
Hi Lucas, thank you for documenting what worked for you on moving the secondary nav in agency pro above the header area. I had posted a couple months ago an inquiry but never received any response. This will help. THANKS!
Wild Web West, LLC
#IHeartGenesisJune 17, 2014 at 3:19 pm #110265
So Lucas, would you be able to tell me what exactly you did to get the secondary nav in a higher priority position? I adjusted my functions command to this:
//** Move Secondary Nav Menu Above Header */
remove_action( ‘genesis_after_header’, ‘genesis_do_subnav’ );
add_action( ‘genesis_before_header’, ‘genesis_do_subnav’, 1 );
How exactly did you facilitate adding a higher priority to the secondary navigation menu to make it appear above the header? My secondary menu is still showing below the header and I wanted it above the header in my agency pro theme. Thanks for any tips.
Wild Web West, LLC
#IHeartGenesisJune 17, 2014 at 3:45 pm #110270
You’re almost there!
If you specify
genesis_before_headeryou’re actually putting it inside the header element. What you want to do it place before that so you need to specify
The code looks like this:
remove_action( 'genesis_after_header', 'genesis_do_subnav' ); add_action( 'genesis_before', 'genesis_do_subnav', 1 );
One more thing, you will need to tweak the CSS for the header (class= .site-header) as it is set to fixed and your secondary menu is going to be hidden beneath it.June 17, 2014 at 4:17 pm #110276
Ah haaa! Thank you so very much Lucas. I’ll give that a spin and all makes sense. I really appreciate your response. Have a great day!
Wild Web West, LLC
You must be logged in to reply to this topic.