Title: Category based navigation menu
Last modified: August 19, 2016

---

# Category based navigation menu

 *  [membrana](https://wordpress.org/support/users/membrana/)
 * (@membrana)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/category-based-navigation-menu/)
 * Hi,
    I’ve been searching for some guidance on this subject but to no avail. I
   want to have an horizontal menu that displays all my **parent categories**, and
   when I click on one of those, below it displays another horizontal menu but with
   the **child categories** of the clicked one. The styling I think I can handle,
   but the php that would display the correct children upon clicking on the parent
   is what I cannot get right.
 * I’ve found that this kind of menu is very used but with pages instead of categories.
   This is a code I found and I replaced every ‘pages’ for ‘categories’, but it 
   didn’t work (it was worth trying…).
 *     ```
       <ul id="nav">
            <?php wp_list_categories('depth=1&title_li='); ?>
       </ul>
       <?php if(wp_list_categories("child_of=".$post->ID."&echo=0")) { ?>
            <ul id="nav-sub">
                 <?php wp_list_categories("title_li=0&child_of=".$post->ID."&sort_column=menu_order");?>
            </ul>
       <?php } ?>
       ```
   
 * Any help will be appreciated.
    Thank you very much for your time!
 * Martín.

The topic ‘Category based navigation menu’ is closed to new replies.

## Tags

 * [based](https://wordpress.org/support/topic-tag/based/)
 * [category](https://wordpress.org/support/topic-tag/category/)
 * [menu](https://wordpress.org/support/topic-tag/menu/)
 * [navigation](https://wordpress.org/support/topic-tag/navigation/)

 * 0 replies
 * 1 participant
 * Last reply from: [membrana](https://wordpress.org/support/users/membrana/)
 * Last activity: [17 years, 7 months ago](https://wordpress.org/support/topic/category-based-navigation-menu/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
