get_cat_id is returning false, but how?
-
I’m having a problem with get_cat_id returning 0/false on categories I know exist and also have posts in them.. I even ran a test, using the category slug provided to get the id, and it doesn’t work either.
The test code looks like;
$vid = get_cat_id('vendors'); $categories = get_categories('child_of=' . $vid . '&hide_empty=0'); foreach($categories as $category) { echo get_cat_id($category->slug) . '<br />'; }
…returns a bunch of 0’s. Any ideas why this isn’t working?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘get_cat_id is returning false, but how?’ is closed to new replies.