Different menu based on page – but with a twist
-
Hi, everybody!
I am currently working on a website for our dance studio with locations in five cities. The problem is that I want to show different menus based on the location the visitor chose.
I understand the basics of that and it is really simple:
1) I created a number of menus under “Appearance – menues”
2) I edited the <?php wp_nav_menu(array( section in my header and added ‘menu’ => get_post_meta($post->ID,’MenuName’,true) to the end.
3) I created a Custom Field so that I have to choose for every page which menu the relevant menu is.All that works like a charm – easy, perfect.
BUT! Not all the pages are different in every location. What I mean is that I may have 4 pages that ar supposed to be in the menu of all the locations. But then I can’t assign a specific location to those pages, because it then would always load the menu of one specific location.
Is there any way to – when entering the site – force the visitor to make a selection, assign a value to that selection, then store it in an ID, cookie or something, and then show the menu based on that ID?
I hope what I just wrote makes sense…
Thank you very much,
Jens
- The topic ‘Different menu based on page – but with a twist’ is closed to new replies.