3

I want to implement two menus that work like this:

  Cars
 *Animals   <-selected
  Recipes
--
  Bear
 *Dog   <-selected
  Cat

So the top menu in the main menu, the the menu below is the sub-menu. Not all main menu items have sub-menus.

Is there an elegant way to implement this? Preferably, selecting the top menu item would select the first sub-menu.

wordpress version 3.03

1 Answer 1

1

I can somehow understand what you are asking for but I think you should make this more clear. You already posted an example, but I think the main problem is: You connect some type of data to each other which is not known to wordpress.

So as long as you don't provide some hint how DOG is related to ANIMAL (okay, this looks obvious on first read, but how are those two menues connected to each other? Computers are dumb silly, so they always need hints, imagine?), the question can not be answered. Sorry.

UPDATE:

See the wp list pages() (Wordpress Codex) and wp_page_menu() (Wordpress Codex) functions. You can make use of those in your theme.

3
  • well, i meant that the second menu is the submenu of the first. so the first menu is the parent, the second is the child. So if the fist menu had selected Cars, then maybe it would show Volvo, Saab & Ford in the second menu.
    – cannyboy
    Commented Dec 27, 2010 at 0:21
  • @cannynboy: How are you implementing those menus? Is that wordpress 3.0 menues? Just asking, because this makes a difference. Please add you worpdress version and the name of the theme to your question.
    – hakre
    Commented Dec 27, 2010 at 0:51
  • i'm not creating menus in the Menus section of the Wordpress backend, i'm merely making Dogs have a parent page of Animals.. etc
    – cannyboy
    Commented Dec 27, 2010 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.