How to display WordPress Category Without the link

By default the wordpress function get_the_category() outputs the category with a link, which is a good thing in most cases. But there comes a time, when you need to output only the category name, without the url. Here’s how you can do it:

<?php $category = get_the_category(); echo $category[0]->cat_name;?>

Good luck.

, ,