testing child

Only Show Children of a Category

The following example code generates category links, sorted by ID, only for the children of the category with ID 1695; it shows the number of posts per category and hides category descriptions from the title attribute of the generated links. Note: If there are no posts in a parent Category, the parent Category will not display.

ID, $taxonomy, array( 'fields' => 'ids' ) ); // separator between links $separator = ', '; if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) { $term_ids = implode( ',' , $post_terms ); $terms = wp_list_categories( 'title_li=&style=none&echo=0&taxonomy=' . $taxonomy . '&include=' . $term_ids ); $terms = rtrim( trim( str_replace( '
', $separator, $terms ) ), $separator ); // display post categories echo $terms; } ?>