webworthydesign
11/9/2015 - 3:08 PM

This will display the category name or taxonomy name for a custom post type (probably regular posts too)

This will display the category name or taxonomy name for a custom post type (probably regular posts too)

https://codex.wordpress.org/Function_Reference/get_the_terms

<?php
//DISPLAY FOR MAIN CATEGORY
$terms = get_the_terms( $post->ID , 'category' );
foreach ( $terms as $term ) {
	echo $term->name;
}
?>

<?php
//DISPLAY FOR MANUFACTURER CUSTOM TAXONOMY
$terms = get_the_terms( $post->ID , 'manufacturer' );
foreach ( $terms as $term ) {
	echo $term->name;
}
?>