Basically, I have created a custom post type and a custom taxonomy for that custom post. The custom taxonomy is hierarchical and the client plans on adding hundreds of categories. Because of this, they want the main page to display only the top level parent which is easy enough. However they want a drill down menu which only shows the parent and the children of the parent so they don't overwhelm the user. I think that what I basically need to do is get the parent id of the child so I can call up just those children.
I have been digging around and the code below is what I have come up with which I know if still far off from what it needs to be. Can you shed any light on this or at least give me a push in the right direction? I'm totally lossed.
I included the code below but I also put in pastebin at http://pastebin.com/B8qtz6Lf
<?php if (is_tax()) {
$this_term = get_term();
if (get_term_children($this_term->term_ID) != "") {
echo "<h2>Subcategories</h2>";
wp_list_categories( array (
'title_li' => '',
'depth' => '1',
'child_of' => '.$this_term->term_ID'
));
}
} else {
wp_list_categories( array(
'taxonomy' => 'compliance_categories',
'title_li' => '',
'depth' => '1'
));
}
?>
Any help you can give me would be awesome!