When I run get_categories() I get back a list of all my categories, one of which is:
 => stdClass Object ( [term_id] => 7 [name] => California [slug] => california [term_group] => 0 [term_taxonomy_id] => 7 [taxonomy] => category [description] => [parent] => 6 [count] => 2 [cat_ID] => 7 [category_count] => 2 [category_description] => [cat_name] => California [category_nicename] => california [category_parent] => 6 )
However, if I run
$args = array( parent => 6 ); get_categories( $args );
I get nothing. If I set parent to zero I get the root categories as expected, but zero is the only value that returns anything. I’m totally at a loss. I’ve tried every combination of hierarchical & hide_empty, but I can’t get any results out of get_categories besides all categories or just root categories. What am I missing? This is making me crazy.
- The topic ‘get_category misbehaving’ is closed to new replies.