Wordpress Joomla Freelancer Web Designer Web Developer Mumbai
http://www.santoshkori.com/blog/how-to-display-selected-category-names-of-custom-post-type-in-wordpress
Export date: Tue Jun 19 4:49:24 2018 / +0000 GMT

How to display selected category names of custom post type in wordpress


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;
}
?>
Post date: 2015-11-28 20:29:37
Post date GMT: 2015-11-28 11:29:37

Post modified date: 2015-11-28 20:29:37
Post modified date GMT: 2015-11-28 11:29:37

Export date: Tue Jun 19 4:49:24 2018 / +0000 GMT
This page was exported from Wordpress Joomla Freelancer Web Designer Web Developer Mumbai [ http://www.santoshkori.com/blog ]
Export of Post and Page has been powered by [ Universal Post Manager ] plugin from www.ProfProjects.com