2

Is there any way to list the child categories only? I just want to filter the Parent Categories

3
  • 2
    What have you tried from get_categories?
    – brasofilo
    Jan 18, 2013 at 16:32
  • I was missing exclude in get_categories it is working now some how. But i have to give the ids manually, is there any way to block the parents?
    – Baig
    Jan 18, 2013 at 16:39
  • 1
    To answer this, you'd better give more details in the Question itself: >>edit<<.
    – brasofilo
    Jan 18, 2013 at 16:42

1 Answer 1

0

The following code is to display the subcategory instead of parent . I am not sure this is the one as you are trying too.

 <ul> 
    <?php 
     $catsy = get_the_category();
     $myCat = $catsy->cat_ID;
        wp_list_categories('orderby=id&child_of='.$myCat); 
    ?>
    </ul>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.