Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to show another menu on a Wordpress page than the standard?

Posted on 2014-09-09
5
Medium Priority
?
189 Views
Last Modified: 2014-09-09
Hi,

I'm modifying a Wordpress theme. The standard menu should show in case A and a newly created menu should show in case B. I already hard coded this in the theme, but how to call the second menu i created in the admin?

This calls the standard menu: wp_nav_menu($args);

How to change it to another menu? Calling it by name would be easy i think.
How to do that?

Thanks!
0
Comment
Question by:peps03
  • 3
  • 2
5 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40312199
You're already 90% of the way there. Read the reference on wp_nav_menu to learn how to call a specific one:

http://codex.wordpress.org/Function_Reference/wp_nav_menu
0
 

Author Comment

by:peps03
ID: 40312210
Thank for your reply Jason!

I did! But it's not really clear to me how to call another menu based on its name (or something else)  instead of the standard menu.
Thanks
0
 

Author Comment

by:peps03
ID: 40312646
Nobody can help?
Would be really great! Easy question for a Wordpress expert!
Thanks!
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 2000 total points
ID: 40312685
Nobody can help?

We're volunteers and other stuff takes precedence over your question.  You need to be patient and allow us time to respond.

But it's not really clear to me how to call another menu based on its name (or something else

The example is in the documentation linked above:

<?php wp_nav_menu( array('menu' => 'Project Nav' )); ?>

Open in new window


Replace 'Project Nav' with whatever you named the menu in Appearance | Menus
0
 

Author Closing Comment

by:peps03
ID: 40312768
Thank you! Got it working!
And yes i know how it works.
Of course i look things up myself before asking it here. Normally a quick Google provides the answer in seconds. So i did come across the page you mentioned but didn't fully understand it. That's why i asked.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question