Different Navigation Menus For Different Pages


Author Message
teewil

Posted: 11/15/2011
Quote message 

Hello Abland! Thank you for your assistance. I followed your directions, correctly I believe, and the end result was the navigation menu disappearing entirely. No menu on any pages. Any ideas? Thanks.
 
Abland

Posted: 11/15/2011
Quote message 

Hi, teewil,

First, your new file is in your theme: "templates/swap-menu.php"?

Second, did you change the page id's in the above code for your own site's page id's?
 
teewil

Posted: 11/15/2011
Quote message 

Hi Abland. Thanks for the fast response. Very much appreciated. I did place the swap menu file into my template files and I did place the proper pages into the file. According to the swap menu file, pages that are not specified for a particular menu should show the primary menu, correct? Problem is non-specified pages are showing no menu at all. None of the pages are showing a menu, as I mentioned. Thanks for any help you can provide in clearing this up.
 
teewil

Posted: 11/15/2011
Quote message 

I'm using version 3.0. Now when you say templates, I'm assuming you mean the templates that are assembled under Appearance > Editor in Wordpress. Am I mistaken in that? Should I be placing the swap file elsewhere? I uploaded the file into my theme's folder and it now appears under Templates on the Edit Themes page (Appearance > Editor). I'm thinking the placement of the file may be the problem.
 
Abland

Posted: 11/15/2011
Quote message 

Hi, teewil,

In wp-admin > Appearance > Menus are the four menu places available under Theme Locations?

If yes, when you selected a menu for each did you save with the button in the Theme Locations area?
 
Britt

Posted: 11/21/2011
Quote message 

Hey Abland!

I love how it works one of the primary pages, but doesn't work in the sub pages.

This is how my multiple pages coding looks:

if (is_page(array(802,88,108,157,289,292,77))) {


Really cool to see how it works on the primary pages.
 
Britt

Posted: 11/21/2011
Quote message 

Rock On!!! All the 7 Shopping Cart Items are all working perfectly!

No Just trying to get the other custom menus working in the shopping cart and checkout and the members area.
 
Britt

Posted: 11/21/2011
Quote message 

Quote Abland:


In the custom menu, all the primary and sub-links are showing as text links only. The buttons have disappeared.

Any ideas?




 
Britt

Posted: 11/21/2011
Quote message 

I don't know how I did this, but I got the buttons to work one way perfectly on the secondary custom menu with 7 page id's, but the 3rd was broken on one of the 2 page id's, and the 4th custom menu is broken on 7 out of 8 page id's.

Another way I got this working but the buttons disappear while showing all the text links as one for the primary and secondary.

The only difference I can see is the extra ) symbol when calling for the second custom menu called checkout.

In the 1st scenario my code looks like:

<?php

if (is_page(array(802,88,108,157,289,292,77))) {

echo theme_get_menu(array(

'source' => theme_get_option('theme_menu_source'),

'depth' => theme_get_option('theme_menu_depth'),

'menu' => 'shopping-menu','class' => 'cpn_hmenu'
) );


} else if (is_page(78,79,82)) {

echo theme_get_menu(array(

'source' => theme_get_option('theme_menu_source'),

'depth' => theme_get_option('theme_menu_depth'),

'menu' => 'checkout-menu','class' => 'cpn_hmenu'
) );


} else if (is_page(387,375,446,365,850,499,709,884)) {

echo theme_get_menu(array(

'source' => theme_get_option('theme_menu_source'),

'depth' => theme_get_option('theme_menu_depth'),

'menu' => 'members-menu','class' => 'cpn_hmenu'

) );


} else {

echo theme_get_menu(array(

'source' => theme_get_option('theme_menu_source'),

'depth' => theme_get_option('theme_menu_depth'),

'menu' => 'primary-menu','class' => 'cpn_hmenu'

) ); } ?>





The 2nd where only the text links appear:




<?php

if (is_page(array(802,88,108,157,289,292,77))) {

echo theme_get_menu(array(

'source' => theme_get_option('theme_menu_source'),

'depth' => theme_get_option('theme_menu_depth'),

'menu' => 'shopping-menu','class' => 'cpn-hmenu'

)

);

} else if (is_page(array(78,79,82))) {

echo theme_get_menu(array(

'source' => theme_get_option('theme_menu_source'),

'depth' => theme_get_option('theme_menu_depth'),

'menu' => 'checkout-menu','class' => 'cpn-hmenu'

)

);

} else if (is_page(387,375,446,365,850,499,709,884)) {

echo theme_get_menu(array(

'source' => theme_get_option('theme_menu_source'),

'depth' => theme_get_option('theme_menu_depth'),

'menu' => 'members-menu','class' => 'cpn-hmenu'

)

);

} else {

echo theme_get_menu(array(

'source' => theme_get_option('theme_menu_source'),

'depth' => theme_get_option('theme_menu_depth'),

'menu' => 'primary-menu','class' => 'cpn-hmenu'

)

);

}

?>


Uuuggghhh, i feel like im so close after dayz of trying to make something work...
 
Britt

Posted: 11/21/2011
Quote message 

Quote Abland:


May I give you an admin's account in the WP?



 
Abland

Posted: 11/21/2011
Quote message 

Hi, Britt,

The best part of a coding project is looking back on it :-D. Glad it's working - I often need to remind myself to check the prefix. Good catch.
 
Darren

Posted: 11/23/2011
Quote message 

How would this be modified to change the custom side bar menus to be different on different pages?
 
Britt

Posted: 11/25/2011
Quote message 

Quote Darren :

How would this be modified to change the custom side bar menus to be different on different pages?


I use a plugin called Dynamic Widgets found @ WP:
http://wordpress.org/extend/plugins/dynamic-widgets/

 
Britt

Posted: 11/25/2011
Quote message 

Quote Abland:

Hey Abland!

I was wondering how to do this in postings and categories/sub-cats.

I'm guessing in either one, in the swap menu php file, just change the is_page to is_post and for categories to is_category?

Thanks again Abland



 
Darren

Posted: 11/28/2011
Quote message 

I looked the dynamic-widgets plugin and I see it lets me select what widgets a page displays, but al looking for a way to display a different vertical menu on each page, any ideas

Quote Britt:

Quote Darren :

How would this be modified to change the custom side bar menus to be different on different pages?


I use a plugin called Dynamic Widgets found @ WP:
http://wordpress.org/extend/plugins/dynamic-widgets/



 
John

Posted: 12/18/2012
Quote message 

How would we do this in Artisteer 4?

thanks
 
Foler

Posted: 8/3/2018
Quote message 

Thanks! I was looking for suc info for me too. I have got some Best News Portal WordPress Themes from https://www.templatemonster.com/category/news-portal-wordpress-themes/ and now I need to make a website. I think this thread will help me with it