Solved

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

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
Could anyone can give me a suggestion about good client friendly theme. 7 31
html input 8 43
SSRS 2016 Rendering HTML tables 3 31
Non-Resizable Pharagraph 2 7
This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to count occurrences of each item in an array.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

830 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