Site logo

[Resolved] I want to have a second menu on certain pages – what is the best way?

Home Forums Support [Resolved] I want to have a second menu on certain pages – what is the best way?

Home Forums Support I want to have a second menu on certain pages – what is the best way?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2559325
    Brent Wilson

    On a site with a primary menu and a hero element, I would like to have a second menu located below the hero element on certain pages. What would be the best way to achieve this?

    In addition, there will be second menus related to different groupings of pages – so that second menu on some pages would be “second menu 1,” while on some other pages, that second menu would be “second menu 2,” etc. Then some pages would have no second menu.

    #2559377
    Ying
    Staff
    Customer Support

    Hi Brent,

    You can create a secondary navigation and set the navigation location to No navigation.

    Then add this code to a hook element, choose the generate_after_header hook, set the priority to 15, and set the display rule per your needs, remember to tick theExecute PHP box.

    <div class="second-nav">
    	<?php 
    	if ( function_exists( 'generate_secondary_navigation_position' ) ) {
    		generate_secondary_navigation_position();
    	}
    	?>	
    </div>

    To have different menu items for the secondary navigation based on pages, you might need a plugin like this:https://wordpress.org/plugins/conditional-menus/

    #2559379
    Brent Wilson

    So if I have 3 different “secondary” navigation menus and want them to display on different pages or page categories, how would I distinguish between them when I set up the hooks?

    #2559399
    Ying
    Staff
    Customer Support

    how would I distinguish between them when I set up the hooks?

    You don’t specify it in the hook but in the plugin.

    Add all menu items into the same menu, assign it to the secondary navigation, then use the plugin to control which menu items to show or not show.

    #2559415
    Brent Wilson

    Okay, I think I have the basics of this working using that plugin that you linked to. But how can I get the secondary nav “bar” to be full screen width instead of I think the 1200px content width? So this page to see what I am referring to: https://uniformministries.albertaadventist.ca/pathfinders/

    #2559424
    Ying
    Staff
    Customer Support
    #2559428
    Brent Wilson

    Thanks! That worked!

    #2559437
    Ying
    Staff
    Customer Support

    No Problem, glad to help 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.