I have a Custom Post Type of "projects", that is categorized by a Custom Taxonomy of "industry", which is heirarchical. Projects & sub-projects are assigned to the industries. For Example, the "Academic" industry contains, three sub-industries of, University, Community College, & K-12. I need to display the list of projects.

For Example:

  -Community College
     -- Gordon Elementery
     -- West Lake High School
          --- Gymnasium
          --- Admin Building
          --- Cafeteria
     -- Jefferson Elementary

Right now, it lists all projects including the subprojects

Basically, if the term has no "sub-terms" it links to the single.php for that term. I also need it to just list the parent term, should that term have "sub-terms" or child terms.

I've played around with get_term_children() but just can't seem to figure out how to work this out. Any suggestions would be greatly appreciated. Thanks

2 Answers 2


Here is some basic setup for the function that MavBzh mentioned.

$args = array(
    'title_li'          => '',
    'taxonomy'          => 'industry',
    'show_option_none'  => '',

<ul><?php wp_list_categories( $args ); ?></ul>

I think you should better use the wp_list_categories function and play with the taxonomy parameter. You'll then have access to more parameters than with *get_term_children* (depth, parent, child_of, hide_empty, etc.)

  • thanks for the suggestion. I'll try that route. I'm pulling my hair out trying to figure this out. I'll let you know how it goes. thanks
    – user29489
    Mar 25, 2013 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.