wordpress get term of post code example
Example 1: wordpress get taxonomy of a post
<?php $term_obj_list = get_the_terms( $post->ID, 'taxonomy_name' ); ?>
Example 2: get taxonomy name in singhle post
// RETRIVE TERM SLUG ( for single.php or template-part )
$terms = get_the_terms( $post->ID, 'your-taxonomy' );
if ( !empty( $terms ) ){
// get the first term
$term = array_shift( $terms );
echo $term->slug;
}
Example 3: how to get all post fields in wordpress
echo '<pre>';
print_r(get_post_custom($post_id));
echo '</pre>';