Support » Themes and Templates » More than 1 menu, but not hierarchy

  • Hi folks,

    I’m designing a website using WordPress.

    I’d like to add another menu, I mean, a new menu, but independent of the primary menu. So, the secondary menu isn’t what I’m searching for.

    I’d be thankful find some information about.

    I only found information about a secondary menu that depends on the primary, you know …

    Could someone help me, please?

    Thanks a lot!

Viewing 5 replies - 1 through 5 (of 5 total)
  • esmi


    Forum Moderator

    You can add as many independent menus/sidebars as you want – each called using get_sidebar.

    Thanks a lot, esmi!

    However, I don’t know how to do it … I need more information, please.

    What I’d like to do is:

    My theme is called “twentyten”.

    I wrote this code in functions.php:

    // This theme uses wp_nav_menu() in one location.
    register_nav_menus( array(
      'primary' => __( 'Primary Navigation', 'twentyten' ),
      'secondary' => __( 'Secondary Navigation', 'twentyten' ),
    ) );

    and in header.php:

    <div id="menu_adicional">
      <?php wp_nav_menu( array( 'theme_location' => 'secondary-menu', 'menu_class' => 'secondary', 'fallback_cb' => '') ); ?>
    <div id="menu_principal">
      <?php wp_nav_menu( array( 'theme_location' => 'primary-menu', 'menu_class' => 'primary', 'fallback_cb' => '') ); ?>

    But, it doesn’t work …

    Could you help me please? You can see the image:

    Thanks a lot!

    The theme locations are primary and secondary, not ‘primary-menu’ and ‘secondary-menu’.

    <div id="menu_adicional">
      <?php wp_nav_menu( array( 'theme_location' => secondary', 'fallback_cb' => '') ); ?>
    <div id="menu_principal">
      <?php wp_nav_menu( array( 'theme_location' => 'primary', 'fallback_cb' => '') ); ?>

    menu_class, defaults to ‘menu’, and it relates to the style.css block for the menu’s, however if you are using an id and not class, you would style as id not class.

    ‘fallback_cb’ => ”, will only output a menu if it has been created and assigned to the Menu Location

    The Second Menu, with different styling, a twenty ten tutorial.

    Add a third menu in the footer area, a twenty ten tutorial.





    Forum Moderator

    I can’t see what’s wrong with your current code.

    Esmi, thanks for your help!

    David, thanks a lot! I’ll read the tutorial that you send me. It’s exactly what I’m searching for!! 🙂 So, I expect it solve my problem!

    I’ll save to my Delicious, too!


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘More than 1 menu, but not hierarchy’ is closed to new replies.