Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Help: I need two main menus; for two seperate areas of a site. WordPress


I am trying to have separate Main Navigation Menus on a per page-basis.

Product: Karma - Wordpress Theme
Website URL:

I need to have two main menus; for two seperate areas of a site I am building for a client,; one is for US based clients ( And, one for Non-US based clients (

I would like to use the menu I built in my custom menus called "US Menu" as the main menu in the following pages, 5740,5678,5748,5603,5645,5717,5704,5726,5744,5656,5746,5800,5825, and 5827. And, I am told by the Karma Theme support team...

"Hello again,

We have already mentioned that it is not possible to have separate Main Navigation on a per page-basis. This is not a theme issue, you just need to engage a programmer to customize a solution for you. As we also mentioned, you can easily find a very affordable and knowledgeable programmer at


So, here I am... Please, help me!

Frustrated Website Builder

Answers (5)


Pixel Coder answers:

Hi Dane,

As with the previous question you can pretty much emulate the use of custom fields.

Using a custom field to store the location of each menu (as it's key) and the value would be the name of the menu to be placed.

It's dependent on knowing the current page so using global $post; is essential. This has been implemented in two locations of your site now with a sidebar and a top menu.

The top menu falls back to the text widget you were using originally when no value is present in the top-menu-to-show custom field and the sidebar falls back to the original sidebar when the same criteria fails.

I've put in a place a drop down menu for the top menu as that area wouldn't hold all those links correctly, and currently this only caters for desktop.

For a mobile version you would want to consider a press to reveal type menu which persists until closed or a link is clicked. This would involve JavaScript.

Hope that helps.

Top Shelf comments:


Can you assist me implementing this, if I give you my login details?


Top Shelf comments:


As for the delay, I just returned from the hospital, if you go to and click the link for Non-US Residents you will find the main navigation menu named "Non US Main Menu", located to the right of the logo, under the top menu, but above the sidebar navigation menu. Directly to the right of the logo, from left to right you will see links for ...

Ivory Tower Capital
ITC Alpha Platform


If you click on I would like to have the menu, to the right of the logo be the "US Menu" which will display from left to right...

***TEST*** (I placed this in the menu to initially differentiate the menus)
Ivory Tower Capital
ITC Alpha Platform


From what I can see, what has been done is modification of the very top toolbar menu and the left nav menu, what I need have been requested to do is to have two different main menus, one for the us and one for the non-us. Can this be accomplished?


Pixel Coder comments:

Hey Dane,

You're all set now, as a by-product of not hitting the correct locations you now have control over menus in three areas with the advice given.


Top menu (Very top, and right)
Primary menu (directly right of logo)
Side menu (inner page menu, to the left)

Hope all is well now. :p

Top Shelf comments:

The Karma Wordpress template by defaults to having one main menu which is probably sufficient for most builds.

As of now, both of the following links display the "Non US Main Menu"



I am attempting to get the number 1 link from above to display the "US Menu" in lieu of the "Non US Main Menu" which it currently displays.


Top Shelf comments:


<strong>You are in fact the man</strong>; thank you for your assistance. How do I award the prize to you, I am obviously rather new to the arena.


Pixel Coder comments:

With a limited time working you will have to remember to manually add a value for each menu custom field.

You have 100% control over which menu on which page.

Ultimately we could do a check to find the top level page and the custom field value then bring the menu based on that.

e.g. if you were pages were structured like this

US PAGES (custom field here with value of "us-menu")

NON US PAGES (custom field here with value of "non-us-menu")

We could search for the parent which would match US PAGE or NON US PAGE and find the custom field value. If we are on a child of US or NON US show the correct menu based on that.

However I feel this is enough flexibility, you seem like you know what you are doing in wp-admin and it's a level of control that's flexible on a per page basis.

Pixel Coder comments:

Hahah thank you, I'm not sure how to award the donation... Had this problem before with someone else who liked my answer but couldn't navigate the site.

Truth is the shoe is on the other foot, and i've yet to ask a question. Hopefully you will get the right answer that $40.00 could come in useful lol. :'(

Glad that's all set, pretty neat functionality.

Top Shelf comments:


I am given the following options on the vote to award page; are you in one of the following groups?

4 groups of people are allowed to vote:

1. The true elite who've earned 1% of all winnings on the site.
2. The top monthly experts.
3. The asker of the question.
4. The admins of this site.

*It also says, "If none of the answers are good, then do not vote! The prize money will instead go the Community Pot."


Pixel Coder comments:

I have no idea, maybe this is a question for admins? Hope they wont charge for re-listing haha.

If they do, and they can rectify this issue would be happy to donate $4.00 to the community pot for asking the question.

It's up to you though, your question, your prize money.

The risk is all on this side. :)

Top Shelf comments:


I would like you to get paid for your work.

That's just good business.



John Cotton answers:

Hi Dane

Are you saying you want a different page to appear if the visitor is not from the US?

Or are you saying you want the same page to appear, but with a different menu? If it's the menu, which one are you talking about? The top one or the one of the left hand side?

Finally, how will you decide that they are non-US? With some script or just ask...?

John Cotton comments:

Assuming it's the menus.....

You need to have something like this in you theme functions file (towards the top):

register_nav_menus( array( 'primary-us' => 'US Navigation', 'primary-non-us' => 'Non-US Navigation' ) );

That will give you two places to create the actual menus you want on the dashboard under Appearance.

Then, in you header.php (presumably, though if the theme is structured differently, it could be somewhere else), have this:

if( 1 == 1 ) { // Some code to determine if you want to show the non-US menu
$theme_location = 'primary-non-us';
} else {
$theme_location = 'primary-us';

wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => $theme_location ) );

Obviously, the 1 == 1 needs to be something completely different, depending on how you want to decide which menu you want to show.



Luis Abarca answers:

Hi Dane, it seems that you post a similar question before.

I can help you if you send me login details, i think this way is quick and simple.

$menu = 'menu-no-us';

$us_pages = array(5740,5678,5748,5603,5645,5717,5704,5726,5744,5656,5746,5800,5825, 5827);

if ( is_page( $us_pages ) :
$menu = 'menu-us';

wp_nav_menu( array( 'menu' => $menu ) );

Luis Abarca comments:

Hi Dane,

Your questions is still "active", so you can't still vote until tomorrow when your question change to "Voting in progress".

if you want to award $40 to Alistair just select 40 and click "vote".


ej_emman answers:

Hello Dane,

If you have difficulties where to place the codes that the experts suggested I am available to work on this for you.

just PM me your login details.

ej_emman comments:

Like on my previous answer, if you want to create a distinct menu in selected pages you
have to create a conditional tags in calling the navigation menu. you just need to replace you current navigation menu with this.

I am pretty sure this works if you are in the right track in editing the template.


$page_arr = array(5740,5678,5748,5603,5645,5717,5704,5726,5744,5656,5746,5800,5825,5827);


wp_nav_menu( array('menu' => 'US Menu' ));


wp_nav_menu( array('menu' => 'Non US Main Menu' ));



Gabriel Reguly answers:

Hi Dane,

Just click[[LINK href=""]] Vote to award prize[[/LINK]] ( as you already did once ), then select <strong>40 </strong>using the dropdown next to Alistar answer.

If you fail do to it in the next 7 hours, I will do for you.