Display Wordpress Taxonomy list with description
Is there a way to display the Taxonomy Description under each Taxonomy in
the list.
<?php
$taxonomyName = "tax";
$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>';
}
?>
No comments:
Post a Comment