我刚得到一个这样的解决方案>>
<?php
$taxonomyName = "com_category";
$parent_terms = get_terms($taxonomyName, array(\'parent\' => 0, \'orderby\' => \'slug\', \'hide_empty\' => false));
foreach ($parent_terms as $pterm) {
$terms = get_terms($taxonomyName, array(\'parent\' => $pterm->term_id, \'orderby\' => \'slug\', \'hide_empty\' => false));
foreach ($terms as $term) {
echo \'<div class="single_cat col-md-3">\';
echo \'<h3>\'.$pterm->name.\'</h3>\';
echo "<ul>";
echo \'<li><a href="\' . get_term_link( $term->name, $taxonomyName ) . \'">\' . $term->name . \'</a></li>\';
echo "</ul>";
echo \'</div>\';
}
}
?>