0

I know how to list all subcategories from a certain category, but don't know how to list all subcategories from all categories.

For example, here is category:

Category 1
    -Child Category1
    -Child Category2
Category 2
    -Child Category3
    -Child Category4
Category 3
    -Child Category5
    -Child Category6

The list i want is :

-Child Category1
-Child Category2
-Child Category3
-Child Category4
-Child Category5
-Child Category6

This is code i have now

<?php wp_list_categories( array(
    'orderby'=> 'id',
    'order' => 'DESC',
    'show_count' => false,
    'use_desc_for_title' => false,
     'title_li' => '',
) ); ?>

1 Answer 1

0

Well, according to official documentation, you should pass depth argument inside your function.

As it's written here

Try this:

  <?php wp_list_categories( array(
    'orderby'=> 'id',
    'order' => 'DESC',
    'show_count' => false,
    'use_desc_for_title' => false,
    'title_li' => '',
    'depth; => 1
   ) ); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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