Ready to get started?Download WordPress


wp_list_categories child of like (1 post)

  1. boborg
    Posted 1 year ago #

    Is it possible to display the sub categories of a current category with the same output layout as <?php the_category(' | ') ?> ?

    Currently I have this code

    <?php $cat_ID = get_query_var('cat');
    $children=  get_categories('child_of='.$cat_ID) ;
    if ( $children && $children != 'No categories' ) {

    This gives all the sub categories but with line breaks but I would like to show them all inline separated by a |.

Topic Closed

This topic has been closed to new replies.

About this Topic