Moving secondary nav in Agency Pro

Community Forums Forums Design Tips and Tricks Moving secondary nav in Agency Pro

This topic is: resolved

Tagged: ,

This topic contains 8 replies, has 3 voices, and was last updated by  wildwebwest 1 month ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #103229

    lucaslem
    Participant
    Post count: 88

    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?

    #103239

    Lauren @ OnceCoupled
    Member
    Post count: 512

    Can’t be sure without seeing the HTML, but I assume it’s because the header position is fixed.

    Best,
    Lauren


    I do custom WordPress work! http://oncecoupled.com
    Contact me directly: lauren@oncecoupled.com

    #103265

    lucaslem
    Participant
    Post count: 88

    Hi Lauren,

    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.

    #103311

    lucaslem
    Participant
    Post count: 88

    I’ve gone ahead and also removed all CSS which affects positioning. No dice; the html is still still the issue here.
    The remove_action works just fine. It’s the add_action which does not seem to be doing anything. Would love any other ideas on this.

    #103691

    lucaslem
    Participant
    Post count: 88

    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.

    #110264

    wildwebwest
    Participant
    Post count: 17

    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
    #IHeartGenesis

    #110265

    wildwebwest
    Participant
    Post count: 17

    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
    #IHeartGenesis

    #110270

    lucaslem
    Participant
    Post count: 88

    You’re almost there!

    If you specify genesis_before_header you’re actually putting it inside the header element. What you want to do it place before that so you need to specify genesis_before.

    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.

    #110276

    wildwebwest
    Participant
    Post count: 17

    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
    #IHeartGenesis

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.