Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

Video: Adding a Second Menu to the WordPress Twenty Ten Theme

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
Video: Adding a Second Menu to the WordPress Twenty Ten Theme

The Twenty Ten theme only comes with one default menu, which is included in the header. However the theme also supports multiple menus, thanks to the use of  register_nav_menus(). Here’s a quick tip on how to take advantage of this function and add a second menu to the Twenty Ten theme.

Watch the Screencast


Open the functions.php file and look for:

// This theme uses wp_nav_menu() in one location.

The next line is where we see the register_nav_menus() being used. As you can see this function accepts an array.

register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'twentyten' ),
) );

primary: this is a key, or name of the menu, this name should be unique within the array

__( ‘Primary Navigation’): this is the vaule of the key, or description of the menu

To add the second menu simply add another key (menu name) and assign a value (enter description) into the array. Here’s an example of what it can look like when adding your second menu:

register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'twentyten' ),
'secondary' => __( 'Secondary Navigation', 'twentyten' ),
) );

This technique can be used in creating other free themes or child themes as well. If you have any questions, feel free to ask in the comment.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. Editorial Staff says:

    Yes, you can use WordPress conditional statements and target each individual page, all single posts page, all archive pages etc.

  2. rtrivett says:

    I created and added the second menu (mirror’s the top one at the bottom) in the ‘twenty-ten-theme’ but it doesn’t display. Not sure how to make it visible???

  3. wiredcanvas says:

    Very useful, thanks!

  4. omermiron says:


    Can i use this as a second horizontal line (below primary navigation).

    I want to make it a submenu for one element of the primary menu.


  5. Mark Baynes says:


    Thanks very much for this – short, sharp and to the point.


  6. Russ says:


    I was trying to add a second menu…i have lost access to my sight adminstration. I now get the following page when I try to access my site or my site administration:

    Parse error: syntax error, unexpected ‘=’, expecting ‘)’ in /home4/findyow1/public_html/wp-content/themes/twentyten/functions.php on line 98

    how do i get back to the function.php to correct this error?

    also… it is obvious that i am not up to this task… are there themes where i will not have to go into the code?

    • Editorial Staff says:

      Remember you have curly quotes… make sure you fix those.

    • Khaled Hakim says:

      Russ, you need to access your website hosting using FTP and then finding the functions.php file, downloading it and editing it with a text editor.

      If you need more help or directions email me:


      • Russ says:

        Thank you Khaled. I have your email, and I am sure I will use it. I really want a very simple website, but I am struggling. I will do some more reading, and contact you if things do not become more clear. …Russ

  7. Russ says:

    I am a complete newbie. If I am understanding correctly, I must repeat the above directions for each menu I wish to add? so if I wanted to add a menu named “Articles” it would look like:

    register_nav_menus( array(
    ‘primary’ => __( ‘Primary Navigation’, ‘twentyten’ ),
    ‘Articles’ => __( ‘Articles Navigation’, ‘twentyten’ ),
    ) );

  8. jane says:

    I’d like a secondary horizontal menu to replace the main menu on certain pages for logged-in members only. Is this possible? Thanks

    • Editorial Staff says:

      Yes, that is possible. You are going to have to utilize the is_user_logged_in hook from the WordPress codex.

  9. Himanshu vyas says:

    When I use this method to create secondry menus, my menus are duplicating each other. I also want to know how to create pages for secondry menus, I am confused little bit. Can you help me?

    • Khaled Hakim says:

      After following the above steps (editing the functions.php file found in your TwentyTen theme directory (http://yoursite/wp-content/themes/twentyten/functions.php ) you will need to log into your wordpress admin panel and click on Appearance (on the right hand side) and then click on MENUS. You will be able to add a new menu there. Make sure that you give this newly created menu the same name you gave it when you edited the functions.php file.

      As for pages under this menu… Simply create pages by clicking on Pages in the right hand menu of the admin control panel. Once you’ve added the pages you want, you can go back to Appearance > Menus > and select which pages you wish to add to your menus. You will be able to add pages easily.

      I hope I was helpful.

  10. Celia says:

    I think i figured out why the menu bar was completely disappearing. But I’d still like to add the second menu into the child’s function.php instead of changing it through the dashboard’s editor.

  11. Celia says:

    I created a child theme…a lot of trial and error since I’m new to that too. But could not get the menu right. Something went screwy with the primary navigation and I’m trying to figure out why. I’d created another menu in the menu manager but when I try to use it as the primary navigation, the entire menu bar disappears. I was wondering if it’s because I’d changed the header size.

    In searching around for an answer, your tutorial seemed the more plausible fix.

  12. Celia says:

    Great tutorial, thanks. I was wondering how to use this for a child theme. I’m a novice to the functions.php and am not sure how to go about using the unhook filter instructions given by the wordpress codex.

    • Editorial Staff says:

      Are you trying to create a child theme of your own? or are you trying to modify an existing one?

  13. Khaled Hakim says:

    Thank you for concise and to the point explanation. Appreciate the time you put into helping others by posting such helpful information.

    I’m bummed that twentyten came with only one menu though. They should’ve atleast created two!

    Thanks Though… looks easy enough.

  14. Ben Joven says:

    Nice…I like how you move the cursor super slow!!!

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.