Solved

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

Posted on 2014-09-09
5
181 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

752 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