Title: get sub cats
Last modified: August 31, 2016

---

# get sub cats

 *  Resolved [lasthope](https://wordpress.org/support/users/lasthope/)
 * (@lasthope)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/get-sub-cats/)
 * hi,
    i want to show sub cats were member is showing main cat
 * for example :
 * when member go to learning cat , display sub cats of learning and when going 
   to blog ,showing the sub categories of blog …
 * please help me 🙂

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/get-sub-cats/#post-7011213)
 * > when member go to learning cat
 * assuming you mean the category archive page for ‘learning’:
 * do you want to show a list of clickable links to the sub cats?
 * if yes:
 *     ```
       <ul>
       <?php wp_list_categories('child_of=' . get_query_var( 'cat' ) ); ?>
       </ul>
       ```
   
 * [https://codex.wordpress.org/Template_Tags/wp_list_categories](https://codex.wordpress.org/Template_Tags/wp_list_categories)
 * you will possibly need to edit category.php in a child theme.
 * if you want anything else, please specifiy in more detail.
 *  Thread Starter [lasthope](https://wordpress.org/support/users/lasthope/)
 * (@lasthope)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/get-sub-cats/#post-7011429)
 * thank you
    -  <?php wp_list_categories(‘child_of=’ . get_query_var( ‘cat’ ) ); ?>
 * bu two notes :
 * 1 – this show “categories” title , how to hide ?
    2 – in categories its working
   fine , for example : i go to website.com/learning , showing {cpanel,whm,whmcs,…}
   but when click on a post of this category , category box is destruct …
 * You can give an email address do I send the screenshot?
 *  Thread Starter [lasthope](https://wordpress.org/support/users/lasthope/)
 * (@lasthope)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/get-sub-cats/#post-7011450)
 * i using this code :
 *     ```
       <?php $this_cat = (get_query_var('cat')) ? get_query_var('cat') : 1; ?>
       <?php $this_category = get_category($this_cat);
       if ( $this_category->parent ) { $this_cat = $this_category->parent; } ?>
       <?php wp_list_categories('child_of=' . $this_cat . ''); ?>
       ```
   
 * from this topic :
    [https://wordpress.org/support/topic/list-child-categories-of-current-category-page?replies=6](https://wordpress.org/support/topic/list-child-categories-of-current-category-page?replies=6)
 * and working fine 😉
    thank you <3

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

The topic ‘get sub cats’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [lasthope](https://wordpress.org/support/users/lasthope/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/get-sub-cats/#post-7011450)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
