How to display category description in this function
-
I have this function that lists child categories on the parent category archive page. Can someone help me to get the category descriptions displayed inline with the titles… thanks heaps.
<?php $term = get_queried_object(); $children = get_terms( $term->taxonomy, array( 'parent' => $term->term_id, 'hide_empty' => false ) ); if ( $children ) { foreach( $children as $subcat ) { echo '<li style="list-style-type:none"><a href="' . esc_url(get_term_link($subcat, $subcat->taxonomy)) . '">' . $subcat->name . '</a> </li>'; } } ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to display category description in this function’ is closed to new replies.