Firstly, I'm trying to display all tags from a taxonomy called 'group'. However, this taxonomy currently contains two tags, from which one of of them has multiple tagchildren.
Update: I should have mentioned it was for a particular post type.
I'd lik to display all posts belonging to those children. So the final result should look something like this:
- Parent Tag A
- Child tag
- Post data
- Child tag
- Post data
- etc...
- Child tag
"Parent" Tag B
<?php $taxonomyName = "group"; $terms = get_terms($taxonomyName,array('parent' => 0)); foreach($terms as $term) { echo '<a href="'.get_term_link($term->slug,$taxonomyName).'">'.$term->name.'</a>'; $term_children = get_term_children($term->term_id,$taxonomyName); echo '<ul>'; foreach($term_children as $term_child_id) { $term_child = get_term_by('id',$term_child_id,$taxonomyName); echo '<li><a href="' . get_term_link( $term_child->name, $taxonomyName ) . '">' . $term_child->name . '</a></li>'; } echo '</ul>'; } ?>