Different Navigation Menus For Different Pages |
|
teewil
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
Quote Abland:
May I give you an admin's account in the WP?
|
|
Abland
|
Hi, Britt,
The best part of a coding project is looking back on it . Glad it's working - I often need to remind myself to check the prefix. Good catch.
|
|
Darren
|
How would this be modified to change the custom side bar menus to be different on different pages?
|
|
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/
|
|
Britt
|
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
|
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:
|
|
John
|
How would we do this in Artisteer 4?
thanks
|
|
Foler
|
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
|
|
|
|