get_categories is not returning all child categories
-
I’m puzzled with this problem. Why this simple piece of code is not returning all the child categories of the parent category? It’s only returning one subcategory instead of all of them.
I’ve added the code in the beginning of a category-my-slug.php file.
$get_categories_args = array( 'child_of' => '35' ); $sub_categories = get_categories($get_categories_args); print "Subcategories:<br />"; print_r ($sub_categories);
And yes, the ID 35 is correct and the subcategories do exist. ??
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘get_categories is not returning all child categories’ is closed to new replies.