Title: Display all sub-category
Last modified: August 24, 2016

---

# Display all sub-category

 *  Resolved [Alcalt](https://wordpress.org/support/users/alcalt/)
 * (@alcalt)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/display-all-sub-category/)
 * I made a custom post type and a taxonomy with pods. My custom post type is call
   books and category_books is my taxonomy. I have novel, biography and comics as
   category. Both novel and comics have children.
 *     ```
       books
         - novel
           - sci-fi
           - fantasy
         - biography
         - comics
           - marvel
           - dc comic
       ```
   
 * I also have a side menu that display category_books as a navigation menu. When
   I click on a term it redirect to a page that list every books with that term 
   as category. The problem is that I use $term->name to display my list and novel
   and comics show nothing since my post are link with their children.
 *     ```
       $params = array(
         'limit'     => -1,
         'where'    => 'category_books.name LIKE "%' . $term->name . '%"'
       );
       ```
   
 * Is there a way to look if a term have a child and if it does then list all their
   post? I want to do something like: if I click on novel it would list all the 
   post link with sci-fi and fantasy and if I click on sci-fi it show normaly (just
   sci-fi).
 * [https://wordpress.org/plugins/pods/](https://wordpress.org/plugins/pods/)

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

 *  Plugin Contributor [Josh Pollock](https://wordpress.org/support/users/shelob9/)
 * (@shelob9)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/display-all-sub-category/#post-5967936)
 * You will need to query by term parent. I illustrate how to do that here:
    [https://github.com/pods-framework/pods-code-library/blob/69e6b7ba8bedeb8128982a1290a84faae38c20e6/example/classes/Pods/field/examples/query-taxonomy-by-term-parent.php](https://github.com/pods-framework/pods-code-library/blob/69e6b7ba8bedeb8128982a1290a84faae38c20e6/example/classes/Pods/field/examples/query-taxonomy-by-term-parent.php)
 *  Thread Starter [Alcalt](https://wordpress.org/support/users/alcalt/)
 * (@alcalt)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/display-all-sub-category/#post-5967989)
 * Thanks it help me but i’m still stuck at the display step. My taxonomy doesn’t
   have custom field but my custom post type link to it do. Should I use **pods()**
   or **get_terms()** ?
 *  Thread Starter [Alcalt](https://wordpress.org/support/users/alcalt/)
 * (@alcalt)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/display-all-sub-category/#post-5968078)
 * Nevermind I found how to do it. Thanks for your help.
 *  Plugin Contributor [Josh Pollock](https://wordpress.org/support/users/shelob9/)
 * (@shelob9)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/display-all-sub-category/#post-5968087)
 * I’m glad you figured it out. I would have suggested `wp_get_object_terms()`

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

The topic ‘Display all sub-category’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Josh Pollock](https://wordpress.org/support/users/shelob9/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/display-all-sub-category/#post-5968087)
 * Status: resolved