0
votes

I have a custom post type. It's have a custom category / taxonomy. It's name is download_category i.e register_taxonomy( 'download_category',.....

I need know the custom category id and slug of a particular post in custom post type.

For example if 120 is my custom post type id then how i get the taxonomy of custom post type under download_category taxonomy . Please help

2

2 Answers

1
votes

$terms = get_the_terms(120, 'download_category' );

print_r($terms );

see the result .

0
votes

By using

get_the_terms( 120, $taxonomy );

get the taxonomy of custom post type