Solved

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

Posted on 2014-09-09
5
157 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 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now