How to get multiple menus in TwentyTen theme?
|
Hi @Himanshu Vyas: There are several steps to creating additional menus using the new menu system in WordPress in the TwentyTen theme or any WordPress theme (of which some of these steps can be done out of order). In addition, I'm going to highly recommend you create a child theme based on TwentyTen instead of modifying it directly:
So let's be on with it! 1. Create a Child ThemeCreating a child theme is extremely simple and gives you the benefit of being able to upgrade TwentyTen if a new version comes out without haven't to worry about loosing your changes. Yes, there's a small chance your changes will be incompatible with the new version, and if you make copies of TwentyTen files and modify them for your child theme you'll need to reapply those changes, but that's much better than loosing your changes when the theme is upgraded. But rather than duplicate my answer from another question where I suggested child themes I'll just point you there: For the examples in the rest of this answer I'm going to call the child theme "Himanshu". 2. Register a Theme LocationRegistering a theme location is very straightforward using the I'll create a "Footer" menu for this example. In my example notice how I reference If you are using a child theme you need to create a
If you are writing code for your own theme and don't need to distribute it to others or worry about translations you can just do this:
3. Create a New MenuNext let's create your footer menu located by navigating to the Menus option of the Appearance menu in the admin console. Click the "+" to add a menu, type the name of your menu and then click "Create Menu":
Note that you'll often name your menu the same as the name of your menu location but that's not required and WordPress treats menus and their menu locations them as separate entities. Be sure to add some options to your menu or it will be of little use. Select the options you need using the admin console, add them to your menu and then save (in my screenshot I only show selecting "Pages" for menu options but you can mix and match what ever types of menu options WordPress provides):
4. Associate the New Menu and the Theme LocationAssociating your new menu with your desired theme location is easy, just use WordPress' admin console:
5. Call
|
Hi MikeSchinkel, I am very thankful to you for your answer. Really thanks. But Mike, I again have a question. Now I just want to add pages for secondary menus, As like default menus. Example : when we create a page it takes automatically place in primary links. How it is possible for secondary links? – Himanshu Vyas Oct 11 '10 at 11:07 |
|
@Himanshu Vyas: No, secondary menus don't automatically get links. How would it know which links go into which menus? But of you want all links in both menus then you don't need to do any of the above except to copy the wp_nav_menu call in header.php and put it in your footer.php, or where ever else you want it. It's perfectly okay to reuse a menu in more than one place on a theme. – MikeSchinkel♦ Oct 11 '10 at 20:00 |
|
Thanks Mike, Now i have clear idea about it. really very very thanks. I was extremely confused about it. Have a nice day – Himanshu Vyas Oct 12 '10 at 12:51 |
|
@Himanshu Vyas - You are definitely welcome, glad I could help. Thanks in advance for selecting this answer as answering your question; just click the checkmark below to the up/down rating controls. – MikeSchinkel♦ Oct 12 '10 at 23:03 |
|
Hello Mike, I have one another question. I am developing a wordpress site and right now I have a custom home page and others are default wordpress pages. Now I want to add one another custom page for some landing page. This page's layout & design is different. How Can I add this to my wordpress website? – Himanshu Vyas Oct 13 '10 at 3:38 |




