0
votes

I've got in my Wordpress a custom post_type, with categories. How to display the category name in the template?

2

2 Answers

1
votes
the_category();

Or if you want to list the categories for a post, comma deliminated:

the_category(', ');

codex is your friend - http://codex.wordpress.org/Function_Reference/the_category

1
votes
//Returns All Term Items for "my_taxonomy"
$term_list = wp_get_post_terms($post->ID, 'my_taxonomy', array("fields" => "all"));
print_r($term_list);
Array
(
    [0] => WP_Term Object
        (
        [term_id] => 145
        [name] => Example Category
        [slug] => example-cat
        [term_group] => 0
        [term_taxonomy_id] => 145
        [taxonomy] => adcpt_categories
        [description] => 
        [parent] => 0
        [count] => 2
        [filter] => raw
    )

)