Title: Category List
Last modified: August 20, 2016

---

# Category List

 *  [ribamar23](https://wordpress.org/support/users/ribamar23/)
 * (@ribamar23)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/category-list-4/)
 * Hi
 * I’m newbie in PHP and WordPress.
 * I want to list all the categories with depth = 1.
 * `wp_list_categories('hide_empty=0&depth=1');`
 * Ok it worked
 * Now I want when a user clicks a category if it has child categories a new panel
   next to original one becomes visible with all the child categories, and so on,
   untill user reaches a category that has no childs.
 * Can anyone help please?
 * cheers

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/category-list-4/#post-2771802)
 * this should show all direct child categories of the current category in the category
   archive page:
 * `<?php if( get_categories('parent='.get_query_var('cat')) ) echo '<ul>'.wp_list_categories('
   hide_empty=0&depth=1&child_of='.get_query_var('cat').'&echo=0').'</ul>'; ?>`
 * [http://codex.wordpress.org/Template_Tags/wp_list_categories](http://codex.wordpress.org/Template_Tags/wp_list_categories)
   
   [http://codex.wordpress.org/Function_Reference/get_categories](http://codex.wordpress.org/Function_Reference/get_categories)
 * for any problems with ‘a new panel next to original one becomes visible’, please
   post a link to your site for more suggestions
 *  Thread Starter [ribamar23](https://wordpress.org/support/users/ribamar23/)
 * (@ribamar23)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/category-list-4/#post-2771822)
 * I need to place a category selector anywhere where first I only get the top parent
   categories and then i select one and see the childs…. and so on untill i get 
   to final category…..
 * it’s for a auction website when user is listing an item and has to choose its
   category

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Category List’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [child](https://wordpress.org/support/topic-tag/child/)
 * [choose](https://wordpress.org/support/topic-tag/choose/)
 * [list](https://wordpress.org/support/topic-tag/list/)
 * [parent](https://wordpress.org/support/topic-tag/parent/)

 * 2 replies
 * 2 participants
 * Last reply from: [ribamar23](https://wordpress.org/support/users/ribamar23/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/category-list-4/#post-2771822)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
