• Resolved zeaks

    (@zeaks)


    I added a second menu area to a Twenty Eleven child theme using.

    <nav id="access2">
    <?php // top menu
    wp_nav_menu( array('container_class' => 'menu-top',
    'theme_location' => 'secondary' ) ); ?>
    </nav>

    in the header then in functions added

    // Add a second menu
     register_nav_menus( array(
     'primary' => __( 'Primary Menu', 'MyTheme' ),
     'secondary' => __( 'Secondary Menu', 'MyTheme'),
     ) );

    It works fine, but I don’t want to be forced to show the menu. If I don’t add a menu to it, then it displays pages. How can I make it just not display unless there is a menu added for it?

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

    (@zeaks)

    For anyone else that might want to do this, change the header code above with

    <?php // Add a top menu
    wp_nav_menu( array('container_class' => 'menu-top',
    	'theme_location' => 'secondary', 'fallback_cb' => '') ); ?>
    </nav><!-- #access2 -->
    <?php

Viewing 1 replies (of 1 total)
  • The topic ‘Twenty Eleven second menu problem’ is closed to new replies.