get_terms not working when child_of is used

Question

I have a custom taxonomy registered as department, which works in other queries but it doesn’t work when I use:

$args = array( 'child_of' => 483 , 'hide_empty' => false);
$subcats = get_terms( 'department', $args );

foreach( $subcats as $category ) {
    echo $category->name;
}

Once we remove child_of, it prints all the terms. Even using “parent” also not working. What am I missing here? In the database I can check that terms exist as hierarchy.

0
Alok 6 years 2015-09-29T08:27:44-05:00 0 Answers 73 views 0

Leave an answer

Browse
Browse