Reputation: 101
I created a custom post type named "company" and have a custom taxonomy "sector" with a few categories created for it.
now I created a post under "company" and assigned a few categories for this post. How to I display the categories that this post is associated to within the post? I tried get_terms() but that just gives me every single category within the taxonomy.
Upvotes: 2
Views: 67
Reputation: 1301
Use:
$array = get_the_terms($post->ID,array('taxonomy' => 'category'));
Upvotes: 1