child category listing


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php // list child categories
  2. $cat_id = get_query_var('cat');
  3.  
  4. $catlist = wp_list_categories('echo=0&orderby=id&title_li=&child_of=' . $cat_id);
  5.  
  6. if ($catlist) {
  7. echo $catlist;
  8. } else {
  9. echo "Please don't print No categories";
  10. } ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.