Reputation: 489
I need help I googled almost everything but not getting category slug using term_id
$term_id
Please help sorry if this question is asked before
Thanks in advance
Upvotes: 5
Views: 14783
Reputation: 674
$term_slug = get_term_field( 'slug', 'your_term_id', 'your_taxonomy' );
Upvotes: 1
Reputation: 3869
You can use $term = get_term_by('id', $id)
see get_term_by() codex page.
Then access slug using $term->slug
.
Upvotes: 3