Display current taxonomy term when inside custom post type

Ok, so I finally found what I needed here:
How to get current term in my custom taxonomy in WordPress?

the last update at the bottom courtesy of @user3208:

<?php   // Get terms for post
 $terms = get_the_terms( $post->ID , 'oil' );
 // Loop over each item since it's an array
 if ( $terms != null ){
 foreach( $terms as $term ) {
 // Print the name method from $term which is an OBJECT
 print $term->slug ;
 // Get rid of the other data stored in the object, since it's not needed
 unset($term);
} } ?>

That solved my issue!
Thanks

Leave a Comment