• Hello there ladies and gentlemen!

    Thank you in advance already for your patience and help!

    I’m trying to create a submenu that is below the menu (or anywhere else independently), that should display only the pages which are in the current selected page. I wonder if wp_nav_menu is capable of doing so.

    I wanted to have an as simple as possible navigation, which is why I stripped the list items and everything unnecessary:

    <nav class="menu" role="navigation">
    		<?php
    			$menuParameters = array(
    				'container'			=> false,
    				'echo'				=> false,
    				'items_wrap'		=> '<span>%3$s</span>',
    				'depth'				=> 0,
    				'theme_location'	=> 'main-menu',
    			);
    			echo strip_tags(wp_nav_menu( $menuParameters ), '<a>' );
    		?>
    		</nav>

    When I add a second container with the same settings but depth, it will display all Items. So there is nothing like, depth 1-1 or 1-2, I suppose. It will include depth 0 also.
    So this is not the solution.

    In the Codex, I found that I can create a custom Walker. Is this what I need/want? Or is there an easier solution before I go and dive into walker?

    Cheers,
    Martin

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Independent submenu displaying pages of current page’ is closed to new replies.