Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to fetch group name in custom post type in wordpress

$terms = get_the_terms($post->ID, 'Enter_your_taxonomy_here' );
if ($terms && ! is_wp_error($terms)) :
    $tslugs_arr = array();
    foreach ($terms as $term) {
        $tslugs_arr[] = '<a href="'. get_term_link( $term ).'">'.$term->slug.'</a>';
    }
    $terms_slug_str = join( " ", $tslugs_arr);
endif;
echo $terms_slug_str;
 
PREVIOUS NEXT
Tagged: #fetch #group #custom #post #type #wordpress
ADD COMMENT
Topic
Name
8+9 =