Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 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.

share|improve this answer
    
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 Dec 27 '10 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 Dec 27 '10 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 Dec 27 '10 at 11:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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