Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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;
}
Source by wordpress.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #taxonomy #singhle #post
ADD COMMENT
Topic
Name
2+2 =