Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Fulfillment API php code sample 1 40
PHP AJAX JSON 2 61
writing a post to a file that is on same folder and same webserver 5 30
Cpanel file manager 8 23
This article discusses how to create an extensible mechanism for linked drop downs.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The purpose of this video is to demonstrate how to Import and export files in WordPress. 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 : Click on Too…
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…

770 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