How can I change which menu is displayed in the primary position?

Community Forums Forums Design Tips and Tricks How can I change which menu is displayed in the primary position?

This topic is: resolved

This topic contains 1 reply, has 1 voice, and was last updated by  theMikeD 1 year, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12175

    theMikeD
    Participant
    Post count: 20

    OK, here is the sitch.

    1. I have support in my theme for the two genesis built-in menus, “primary” and “secondary.”

    2. I have two menus defined: “Desktop” and “Mobile.”

    3. The “Desktop” menu is in the “Primary Navigation Menu” position (this position being defined by genesis, as noted earlier). The “Mobile” menu is currently unassigned.

    What I need is either of the following, which will have the same effect:

    A. change the menu assigned to the “Primary Navigation Menu” from “Desktop” to “Mobile.”

    B. when the primary menu is shown, show the secondary menu instead (this implies that the “Mobile” menu is assigned to the “Secondary” position).

    I’d like to do this in PHP. Basically, what would be ideal is the following:

    if ( condition is met ) { assign “Mobile” menu to the primary position }

    Can anyone provide any guidance on this?

    #12184

    theMikeD
    Participant
    Post count: 20

    Figured it out:

     

    if ( condition ) {
    remove_action( ‘genesis_after_header’, ‘genesis_do_nav’ );
    add_action( ‘genesis_before_header’, ‘genesis_do_subnav’ );
    }

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

You must be logged in to reply to this topic.