Support » Theme: Twenty Eleven » On Adding Second Menu to Twenty Eleven

  • noelhefele

    (@noelhefele)


    To add a second menu, I added the following code to my child theme functions.php file.

    /*
    adding footer menu, second nav to child theme
    */
     register_nav_menus( array(
     'primary' => __( 'Primary Menu', 'CHILDTHEMENAME' ),
     'secondary' => __( 'Secondary Menu', 'CHILDTHEMENAME'),
     ) );

    This brought up a 2nd menu in the Theme Menu options.

    I then was able to place it in the footer, calling it with the following code:

    <?php // footer menu
    wp_nav_menu( array('container_class' => 'menu-footer',
    'theme_location' => 'secondary' ) ); ?>

    I thought I would post this as I didn’t find any explicit information on how to do this… and it seems to have changed slightly from twenty eleven. Hope it helps those who are looking…

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thanks noelhefele – it works (and saved me a bit of scratching about)…

    Thank you!

    Thanks

    I was able to use the first part of code here to enumerate the menu.

    Then just use the drag drop admin interface to place a custom menu into a widget.

    Great! Very simple, thanks @noelhefele. Is there a way to center this on the page? I tried adjusting the CSS, but no luck. The menu bar starts on the left of the page…Thanks!

    chrisboggs

    (@chrisboggs)

    Heartfelt thanks here too! It was nice to just find a simple core answer and not all the “this is how ftp works” kinda stuff that a full tutorial kinda needs to supply.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘On Adding Second Menu to Twenty Eleven’ is closed to new replies.