WordPress.org

Support

Support » WP-Advanced » [Resolved] Listing Subcats on a Category Page

[Resolved] Listing Subcats on a Category Page

  • I am a php newbee. I am tring to get a list of Child Categories listed on a Category page. If I have a Category called ‘Books’ I want it to write the Subcats of ‘Books’ on the page. I have the below code that gets me the category number and writes it .. which i dont need.

    I want the wp_list_categories to only list the children of the category they are in

    <?php
    $cat = get_the_category(); $cat = $cat[0]; echo $cat->category_parent;
    wp_list_categories('child_of=21');
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Listing Subcats on a Category Page’ is closed to new replies.
Skip to toolbar