0
votes

I m making a WordPress portfolio theme for the WordPress theme directory. I created a taxonomy (name: speciality) for my custom post type portfolio. I can get the list:

echo get_the_term_list( $post->ID, 'speciality', 'Portfolio Specialities: ', ', ' );

But I need a list of slugs for this 'speciality' taxonomy. Even I want single slug-name ' speciality's' taxonomy.

How can get this custom taxonomy's slug/slug-name list?

1
oh my god, nobody found for this question? - Saiful Islam

1 Answers

2
votes

The following code should help

$terms = get_the_terms( $post->ID, 'speciality' ); 

foreach( $terms as $term ) {
    echo $term->name . " : " . $term->slug; 
}

Check the Codex for further info