How to display selected category names of custom post type in wordpress
Posted on November 28, 2015 Posted Under Wordpress, Wordpress Freelancer
0 comments
Here is code snippet to display selected category names of custom post type in wordpress. To get the categories of a custom post type you have call get_the_terms() and setup the registered category name like this <?php $terms = get_the_terms( $post->ID , ‘myposttype_category’ ); foreach ( $terms as $term ) { echo $term->name; } ?>