Happy Halloween! Get 20% off GP Premium with the discount code: HALLOWEEN20

[Resolved] How to create new navigation location and display using elements?

Home Forums Support How to create new navigation location and display using elements?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #919674
    William Hamm

    I need to create a navigation that will reside on only a handful of pages. I would like the client to be able to mange this via menus, and I’ll include it via elements & display rules.

    Leveraging the existing Secondary Menu might work; but how would I stop displaying that globally, and instead include it via elements & display rules?

    Ideally I would be able to create a new menu and then include it via elements & display rules – maybe using a shortcode? I say this because the client *may* want more than one new navigation, specific to certain content areas.

    Many thanks, Will

    #919680
    David
    Staff
    Customer Support

    Hi there,

    you can hook the secondary navigation using a Hook Element with this code:

    <div class="second-nav grid-container">
    	<?php generate_secondary_navigation_position(); ?>	
    </div>

    Select the Hook where you want to place it.
    Check the Execute PHP checkbox.
    And set your display rules.

    In the Customizer > Layout > Secondary Naviagation set the Location to No Navigation.

    To create different navigation instances will be difficult and require custom development. Instead i would suggest a plugin like:

    https://en-gb.wordpress.org/plugins/if-menu/

    or

    https://wordpress.org/plugins/conditional-menus/

    #919693
    William Hamm

    That works perfectly for this purpose, thank you very much!!!

    In the future, if we could create new menu locations easily that would help.

    Best regards, Will

    #919699
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.