WordPress.org

Ready to get started?Download WordPress

Forums

wp_list_categories child of like (1 post)

  1. boborg
    Member
    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' ) {
    wp_list_categories('title_li&hide_empty=0&style=none&child_of='.$cat_ID);
    }?>

    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