Reputation: 51
I'm trying to get the category name via the_slug() but I can't get it displayed via several methods. Does anyone know what's the right term?
Upvotes: 3
Views: 110
Reputation: 411
So you have the slug but want to get the name?
$_cat = get_category_by_slug('category-slug'); // Returns Category Object
$_category_name = $_cat->name;
Upvotes: 3
Reputation: 1916
You should use get_term_by. Example:
$term = get_term_by( 'slug', $value, $taxonomy );
echo $term->name;
Upvotes: 4