So I've got the custom post type working, and I registered the category taxonomy. When I use
<?php $category = get_the_category(); print_r($category); ?>
Array (  => stdClass Object ( [term_id] => 1 [name] => Food [slug] => food [term_group] => 0 [term_taxonomy_id] => 1 [taxonomy] => category [description] => [parent] => 0 [count] => 2 [object_id] => 17 [cat_ID] => 1 [category_count] => 2 [category_description] => [cat_name] => Food [category_nicename] => food [category_parent] => 0 ) )
so I know it's working. However, whenever I try to extract the cat_name or category_nicename, it returns nothing. The specific code I've tried:
<? echo($category->category_nicename); echo($category['category_nicename']); ?>
<? $name = $category->cat_name; echo $name; ?>
No matter what I do, I can only get the entire array, never the specific variable. Am I missing something here?