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

How to Add Custom Navigation Menus in WordPress Themes

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Add Custom Navigation Menus in WordPress Themes

Do you want to add custom navigation menus in your WordPress theme? By default, many WordPress themes come with pre-defined menu locations and layouts. In this article, we will show you how to add more navigation menus in your WordPress theme.

Add Navigation Menu to Themes

When Do You Need this WordPress Navigation Menu tutorial?

Most WordPress themes come with at least one spot where you can display your site’s navigation links in a menu.

You can manage menu items from an easy to use interface inside your WordPress admin area.

If you’re just looking to add navigation menus on your website, then follow our beginner’s guide on how to add a navigation menu in WordPress.

This tutorial is geared towards DIY users who are building a custom WordPress theme or someone who needs to add additional menu locations to an existing WordPress theme.

Having said that, let’s take a look at how to add custom WordPress navigation menus in your theme.

Creating Custom Navigation Menus in WordPress Themes

Navigation menus are a feature of WordPress themes. Each theme can define their own menu locations and menu support.

To add a custom navigation menu, the first thing you need to do is register your new navigation menu by adding this code to your theme’s functions.php file.

function wpb_custom_new_menu() {
  register_nav_menu('my-custom-menu',__( 'My Custom Menu' ));
add_action( 'init', 'wpb_custom_new_menu' );

You can now go to Appearance » Menus page in your WordPress admin and try to create or edit a new menu. You will see ‘My Custom Menu’ as theme location option.

Custom menu as theme location

If you want to add more than one new navigation menu location, then you would need to use a code like this:

function wpb_custom_new_menu() {
      'my-custom-menu' => __( 'My Custom Menu' ),
      'extra-menu' => __( 'Extra Menu' )
add_action( 'init', 'wpb_custom_new_menu' );

Once you have added the menu location, go ahead and add some menu items in the WordPress admin by following our tutorial on how to add navigation menus for beginners.

This will allow us to move on to the next step which is displaying the menu in your theme.

Displaying Custom Navigation Menus in WordPress Themes

Next, we need to display the new navigation menu in your WordPress theme. The most common place where navigation menus are usually placed is in the header section of a website just after the site title or logo.

However, you can add your navigation menu anywhere that you want.

You will need to add this code in your theme’s template file where you want to display your menu.

wp_nav_menu( array( 
    'theme_location' => 'my-custom-menu', 
    'container_class' => 'custom-menu-class' ) ); 

The theme location is the name that we selected in the previous step.

The container class is the CSS class that will be added to your navigation menu. Your menu will appear as a plain bulleted list in your website.

Custom menu displayed as plain list

You can use the CSS class .custom_menu_class to style your menus. Here is a sample CSS to help you get started:

div.custom-menu-class ul {
    list-style-type: none;
    list-style: none;
    list-style-image: none;
div.custom-menu-class li {
    padding: 20px;
    display: inline;

If you need further assistance with the CSS and menu layouts, then we recommend using one of these WordPress starter themes to build out your custom themes.

Creating Mobile-Friendly Responsive Menus in WordPress

With the increase in usage of mobile devices, you may want to make your menus mobile-friendly by adding one of the many popular effects.

Responsive menu plugin demo

You can add a slide out effect (above), dropdown effect, and even a toggle effect for mobile menus.

We have a detailed step by step guide on how to make mobile-ready responsive WordPress menus.

Do More With WordPress Navigation Menus

Navigation menus are a powerful web design tool. They allow you to point users to the most important sections of your website.

WordPress allows you to do a lot more than just displaying links in your menu. Try these useful tutorials to extend the functionality of navigation menus on your WordPress site.

That’s all, we hope this ultimate guide helped you learn how to add a navigation menu in WordPress. You may also want to see our list of 25 most useful WordPress widgets for your site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

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. Munna Hossain says:

    Helpful article. I am a WordPress user and this tips will help me to add custom navigation menus. Thanks for sharing.

  2. Daniel Keith says:

    Hi there,
    Great tutorial. How can I apply CSS to this custom menu?
    Though this is a great way to add multiple menus but without proper CSS the website look odd.

  3. Zaheer Abbas says:

    I m creating my word press theme but menu and widget is not showing in admin panel ???
    is it built in features in word press or i have to create menus and widgets with code plz guide

  4. Tabitha says:

    How can I make my drop down menu into columns? My current drop down is too long.

  5. Aakash Salunke says:

    I’m little bit advanced user. My theme supports only one menu. But I want to add one more menu. I have made it but how can I add?

    • WPBeginner Support says:

      First you will need to register the menu location, then you will need to edit your theme files to display your navigation menu.

  6. bobit says:

    its worked, thanks for the great post

  7. Aijaz Ansari says:

    Awsome, tutorial, it really helps a novice like me.

  8. Victoria says:

    Thanks for the article!!! I created my new menu.
    I have a problem though.
    My website has a fixed width, and when I resize the window everything stays in place, exept for the new menu. Min-width is not an option because it’s not exactly the behavior I want.
    How can I make it behave the same way as the rest of the contents of the page?

  9. Joey says:

    THANKS! I was looking a long time for this, never thought it was so simple.

  10. Cory says:

    i have a crazy old theme that didnt support WP 3.0+ menus. This tutorial was so easy. Took me 3 minutes to bring it a little more up to date. thanks so much.

  11. Jacques Goudreau says:

    Thanks for the tip! Great tut!

  12. Emma says:

    Where do you even go to make these changes? I can’t see any of those options under the Theme or Theme Options tabs.

    I use the Buenos Theme, but can’t find on the Buenos theme page does it support these changes? I want to put in an Archive menu with a list of all the recipes on my blog… should be easy but proving impossible :(

    • Editorial Staff says:

      Most themes do support this. Look at Appearance > Menus. This article is for theme designers who want to add this feature in their themes to allow users to add menus from the backend.

  13. Zoe says:

    I’ve been trying to add a custom class to a singular custom url (to change the color of just one url) in the Top Nav Menus section, but it just adds my class as an extension of the existing class in the output source code and nothing happens.

    Here’s my css code and the source code that is output on my site:

    .myCustomClass { color: #FFFF00; }

    A one-off colored link

    Any suggestions on how to get this to work?

  14. Jeremy Johnson says:

    I was able to implement these modifications and the custom menu works. However, the css in my chosen theme doesn’t seem to support sub-menus. The submenu item is always visible, mousing over the parent item does nothing, and the parent menu item is as wide as the wider child item which pushes the other menu items farther to the right than they should be. Any suggestions on making the sub-menu act dynamically? I’m fairly new to CSS.

    • Editorial Staff says:

      The best place to start would be to take the default Twenty Eleven theme. Use the navigation CSS from there, and start modifying.

  15. shaunling says:

    This is just great!

  16. digitfox says:

    Yeah! its a nice tutorial for me! I am very new to WP! Thanks

  17. PauloNeves says:

    I need help.
    Follow all steps, but in Apparance Panel the option menu not enable.
    When select other theme working.
    How do enable option menu?
    Paulo Neves

    • wpbeginner says:

       @PauloNeves You have to add this line in your theme’s functions.php file: add_theme_support( ‘menus’ );

  18. Brad says:

    Thanks for this! Worked awesomely for me and helped my client a lot! – aptdesign 

  19. eeebasic says:

    That is very helpful me although wordprees 3.3 version released few days ago.

  20. citydan says:

    I have followed the instructions and this post and the post here (, and figured out how to get my CSS to make the menu appear correctly, but the child items (sub menu items) are not appearing. I have them set up correctly in the menus editor, but on the site they do not show. They are not hidden by CSS because they are not there in the source code of the page.

    Any ideas why my menu sub-items are not showing?

  21. GourabMalla says:


    I have added the custom menu in top navigation but want to know how can I active the “Current Page Class”.

    I’m using WordPress 3.2



  22. DanFlynnDesign says:

    Thank you! Love how this is all dynamic so the client can edit if needed, plus able to state which is the current page and apply hover effect! EXACTLY what I was looking for!

  23. asharperrazor says:

    I have tried this many times. I have an old wordpress theme. So old I’m not even sure what version of wrodpress it was written for. Anyway, I can get the functions part to work. I can save the correct menu. I can put the code into other parts of my website, say the footer, although it displays as a hierarchy list and not horizontally.

    Won’t display in the top nav menu. Do I need a new theme or is it possible to edit my current theme to allow the new menu function?

    Thanks in advance. The website is

  24. JamesGeorge says:

    I implemented this with NO problems-thank you! I took the “nav menu” code and put it in the div where my client’s theme was calling the list of pages. I basically replaced it with your code from above and uploaded it, and the css kept it in the same style. It looks great and functions perfectly. AWESOME!

  25. ÁlvaroBenavides says:

    I really need help implementing the CSS of the classes, so please notify when u finish!

  26. Bec says:

    Great post – thank you!

    I have implemented as above and my menu items are showing on site only problem is that each page is empty?!

    any ideas?

  27. Joseph McCullough says:

    Quick and dirty – the way I like my code snippets. Thanks a bunch.

  28. Paul says:

    I have created custom navigation menus a couple of times. What is weird is that after I create and save them, they appear for a while and then the navigation bar returns to 2 tabs only as if the settings are automatically overwritten. On sites with the same template were I never created a custom bar they display correctly.
    Any ideas?

  29. Narendra Choudhary says:

    You can define custom classes to each navigation, and then add image in the background. You can even use CSS (text-indent) property to get rid of the Menu text if you want.

  30. Ram says:

    I have a question on nav menu,
    is there any way to add the image to the list of navigation menus..


    • Editorial Staff says:

      You can define custom classes to each navigation, and then add image in the background. You can even use CSS (text-indent) property to get rid of the Menu text if you want.

      • Ram says:

        thanks for your response but i need more clearly that custom menu image for the wordpress.
        Im using wp_list_categories(‘exclude=4,7&title_li=’); to show the navigational menu so is it any possibility to add the different images to the different menu button. Im trying the CSS but it never works for me :(


        • Editorial Staff says:

          Yes it is possible to add different images with the custom menu. The one you are using is not the menu that we are talking about in this article.

  31. Julie @ Inspired to Write says:

    Can you add code to make it look more presentable (fonts, buttons, size, etc)? If so, can you give me an example and where to put this code? Thanks!

    • Editorial Staff says:

      That is a CSS related question. You will have to add the font size in the appropriate classes in the CSS file. We will be doing a writeup on the CSS styles soon.

  32. Chris says:

    Question about the menu handling.

    I have a menu that is right aligned, so the menu items show up in reverse order.

    Is there a way to sort the menu_order in REVERSE?

    so: sort_column’ => ‘menu_order’ would have something added to reverse the order.


    • Editorial Staff says:

      Just because they are right aligned, shouldn’t make it appear in reverse order. To fix that, you need to change your CSS rather than reversing the hook. Make a container div that is aligned right, and then make the list tags float left.

  33. Julie says:

    Have followed instructions but after creating menus and adding appropriate categories to use, I can’t see them in my nav bar – any ideas what I have done wrong?

  34. dan says:

    You also need to add this to your functions.php file in order for you to use the menus

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

    • Editorial Staff says:

      Certainly a thing that you should have when releasing free themes, but for custom themes it all depends on what you need. Sometimes you don’t have to register locations.

  35. errr says:

    i’m soooo not following … could u be more clear where i would plug this code (add_theme_support( ‘menus’ );) into the functions.php file?

    i’m totally lost

    • Editorial Staff says:

      Somewhere within the php tags. If you do not have PHP experience, we recommend you hire a professional.

      • BanyanTree says:

        If you are going to write articles for newbies, it follows you should answer simple questions. Otherwise, just pay for ads to push your business and save the pretense.

        • wpbeginner says:

          @BanyanTree Adding codes to functions.php file is not that hard. You paste it within the php tags. We have written an articles like this: But its just impossible to link to that one article from all of our articles. When someone asks you how do I change the background in CSS and you tell them that you add background: #000 or another hexcode in the CSS property thats help enough.Now if they ask where in the CSS file I paste that, then that is something you need to know before hands. This site is not a PHP for Dummies site or CSS for dummies site. We do our best to help as much people as possible for FREE.

        • BanyanTree says:

          @wpbeginner@BanyanTree You don’t need to link to articles, no one asked for that. Three words answers his question; “at the end,” which is easier to type than a snide remark. Keep in mind, you named your site; “wpbeginner,” and if that’s the audience you seek, cater accordingly.

        • wpbeginner says:

          @f1mktsol Yes and the site has grown beyond the audience we initially started with. This site has evolved. That is why we have categories… The word “beginner” is being used on a relative scale.

          We have articles for Very Newbies who are just users in our Beginners Guide Category… We also have articles in our WordPress plugins category that are catered to that audience.If you are in our WP Themes category, then the articles are written for beginning theme developers. They are beginners in the developer area. Same with the tutorials.

          Hope that explains it.

        • f1mktsol says:

          @wpbeginner If you’ve outgrown your name, you should change it to suit the audience you seem to prefer. Consider consulting a professional.

  36. Skubeedoo says:

    I added add_theme_support( ‘menus’ );
    and saw no option in the admin panel [where do i look?] I’m using intrepidity theme. I’m a noob, so it might be right in front of me and don’t know the difference. I have a website that has a WP inside it and want to be able to navigate out of WP and back to my main URL. All I need is a “Home” nav link.
    Thanks in advance.

  37. ianarosh says:

    friend you have an awesome site and I am glad i’ve found it!
    I was killing my head to figure how to add the costum menu and it was easy after i’ve seen this! Simply amazing.

    A sugestion ever pondered in making posts about blog/server security? (not sure if you’ve had already need to explore more :O)

    Best regards and keep the good work mate!

  38. Charles says:

    Can any of you tell me how to add support for multiple menus in the functions php file. I want to include two set’s of menus

    • Editorial Staff says:

      You don’t need to have two set of functions.php… Just call the main function. Create multiple menus using the user interface in wp-admin. Then you would have to call the menus in the php code.

  39. Jamie says:

    Just to let you know but the following:

    “add_theme_support( ‘nav-menus’ );”

    Has changed in the final release to:

    “add_theme_support( ‘menus’ );”

    Thanks! :)

  40. Jacob says:

    Great. Just what I was looking for. How do you add the menu slug to the function?

  41. Chris Creed says:

    Thanks for this – I’m currently playing around with the new menu system – it’s a great additional feature that’s going to make things so much easier. I develop themes and get quite a few support requests from people wanting to create custom navigation sections on their site – the new menus should hopefully help to simply things a lot (especially for people with little WordPress experience).

  42. Gopal Bhattacharjee says:

    I am also testing WordPress 3.0 Beta, now I can play arround with menu…Thanks!

  43. Angie says:

    I am wondering how to remove HOME from my nav menu using WP 3.0 beta. Do I edit the wp_nav_menu function or is there some other way?

    If I edit the function, can you provide instruction?

  44. Kevin says:

    Its a pity there’s no way to add the “home” page to the menu from within the menu builder. This is a major flaw.

    • Editorial Staff says:

      Why not? You can create a custom navigation link called Home and add your homepage URL to it.

  45. Noor says:

    I am also testing WordPress 3.0 Beta and I found few bad things in Menus…e.g it is inconsistent and hope till the final release it will become consistent

  46. michelle says:

    nice tutorial! thanks for the share!

  47. Mani Viswanathan says:

    Good Tutorials first up! will be useful while I upgrade to 3.0

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.