• I am using Twenty-Ten theme at the moment.
    I would like to only show the top level (parent-less) and first child pages (pages with parent that is top level) in the top menu.

    That means there would be just a single drop down menu and not a menu to the side of the drop down.

    Is there a way to do this?

    Or, perhaps there is a way that I can just mark a page as “Do not put me in the top menu.”

    Basically I need to have about 20 pages related to a particular area and do not want to have a huge menu in the header. I can just put links (list style) on an index type page.

    Any suggestions are most welcome.

    Thanks,
    Claude

Viewing 1 replies (of 1 total)
  • Thread Starter gxxaxx

    (@gxxaxx)

    Turns out to be totally simple to do. If you know the functions, <sheepish grin> or know how to search in the documentation.

    On https://codex.www.ads-software.com/Function_Reference/wp_nav_menu there is an excellent run down on the wp_nav_menu function.

    The Twenty-Ten header.php file had the following line in it:

    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary') ); ?>

    I added ‘depth’ => ‘2’ and all was fine.

    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary', 'depth' => '2' ) ); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘How do I show only top level and first child pages in menu’ is closed to new replies.