I have a website that has a main menu(Top-Horizontal) like this:
Main menu
- Home
- About Us
- contact us
On Home page I have a link to “Company” page like this www.xyz.com/company.
When I am on this company page I want my website to chnage my menu items and use this:
Different menu
- Home (same Home page link that will take user to www.xyz.com)
- promoters
- Gallery
- Maps
I think i can do this using wordpress Conditional_Tags, but really dont know how should I start.
You can try it this way. Now we are talking about pages you can set up a separate template for the page that needs a different menu. This where WordPress’s newer menu feature is really nice.
First if you are using the newer menu feature of WordPress place this in place of your current menu:
Next put this at the top of the template file that you are going to use for the page. This tells WordPress that this is a page template.
Then place this in your template where your menu should go for this template:
Now we have to make sure that they will be activated. In your theme’s functions.php file you will need to place this:
Once this is all done all you need to do is go to your dashboard > Appearance > Menu
and create your menus there. Once created save then on the left it will give you the option of where to place which menu where via the drop downs.
After all this is set up when you set up a new page all you have to do is select the template you want to use.
I hope this helps if you have questions just ask.
Diferent menu in diferents pages using custom field in page
–> functions.php
You can use the free plugin Conditional Menus. I use it on my projects and it always works like a charm!
Conditional tags would liekly be the way froward. How are you calling your menu?
wp_list_pages()
I assume?If so, you can make use of the
exclude
argument, using something like below (obviously tweek the page numbers and the conditional tags to your needs) –There is a plugin for this that looks promising.