pablocattaneo
7/16/2015 - 2:17 AM

Returns subcategories (categories child) from a specific term.

Returns subcategories (categories child) from a specific term.

<ul>
  <?php
      $categoryID = get_category_by_slug( 'blog' ); /*Retrieve category object by category slug*/
      $categoryID = $categoryID ->term_id; /*Get the term id*/
      $args = array(
        'child_of' => $categoryID,
        'title_li' => __( '' )
      ); 
      wp_list_categories( $args ); /*Display or retrieve the HTML list of categories.*/
  ?>
</ul>