Okay, so I have a Wordpress template that I created that only displays posts that have the \"workout\" category associated with it. Within the loop that displays those, I want t
Get the category objects:
$cats = get_the_category($id);
Just echo the name:
echo $cats[0]->name;
If you want to output a link, use this:
name; ?>
Note: instead of wp_get_post_categories($id)
, you could just use get_the_category()
.
Update: if you want to display all the categories, just loop through them:
name; ?>