working on a journal website, having custom post type "publications" with custom taxonomy "issue". In the custom taxonomy admin enter first the volume number as parent and then the issue numbers as child terms of the parent volume terms. I use this code to display a list of all issue terms but without their parent terms:
$taxonomyName = "age";
$parent_terms = get_terms($taxonomyName, array('parent' => 0, 'orderby' => 'slug', 'hide_empty' => false));
echo '<ul>';
foreach ($parent_terms as $pterm) {
$terms = get_terms($taxonomyName, array('parent' => $pterm->term_id, 'orderby' => 'slug', 'hide_empty' => false));
foreach ($terms as $term) {
echo '<li><a href="' . get_term_link( $term->name, $taxonomyName ) . '">' . $term->name . '</a></li>';
}
}
echo '</ul>';
this code displays a list like this:
- issue 1
- issue 2 ...
What I need exactly is getting the parent terms with the child terms to display the list as:
- vol 1, issue 1
- vol 1, issue 2
Any help please?