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 have 3 menus of categories, and each menu with diferent level of categories.

First menu with First level categories:

  • category 1
  • category 2
  • category 3

If I go to the first category, I want to show a second menu under de first one with child categories of current category:

  • subcategory 1.1
  • subcategory 1.2
  • subcategory 1.3

And finally, if I go to subcategory 1.1, I want to show a new menu with child categories of current subcategory:

  • subsubcategory 1.1.1
  • subsubcategory 1.1.2
  • subsubcategory 1.1.3
share|improve this question
add comment

1 Answer

wp_list_categories(); will by default give you a hierarchically nested list of all your categories. Hiding and showing that list, or parts of it, is just a matter of CSS. That sounds like what you need. For example

echo '<ul class="my-cats-list">',wp_list_categories(),'</ul>';

// style rules; put in your theme's style.css
.cat-item {
  padding-left:5px;
}
.children {
  display:none;
}
.cat-item:hover>.children {
  display:block;
}

That is very minimal but does work.

share|improve this answer
    
Hi!But I want separate menus not in the same list. –  Mike Apr 21 '13 at 14:39
    
I don't know what that means. Are you talking about clicking a menu and then going to another page for the second menu? –  s_ha_dum Apr 21 '13 at 14:41
    
For example, when I click in a category of the first menu, I will show the first menu and the second menu with his child categories –  Mike Apr 21 '13 at 14:45
    
That is almost what I did. Replace the > in the last rule with a space and that is what you should have. But I suspect that you are still not being clear about what you want. Please edit the question with much more detail. –  s_ha_dum Apr 21 '13 at 14:48
    
I want separate menus in diferente divs –  Mike Apr 21 '13 at 14:54
add comment

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.