views:

80

answers:

1

I want to know if has a function that return only the first level of subcategories children.

Cat 1
   Sub-1.1
   Sub-1.2
       Sub-1.2.1
Cat 2
   Sub-2.1

Here I want only: Sub-1.1, Sub-1.2 and Sub-2.1

Cause using get_categories with child_of parameter brings me all children until the last node:

get_categories('orderby=id&show_count=0&title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID);

Thanks

+1  A: 

Please try

wp_list_categories(array('depth' => 2));
boxoft
thanks, but this function was not customizable for my needs. So I found that get_categories('parent='.$id) returns only categories that are direct descendants =D
Luccas