Skip to content Skip to sidebar Skip to footer

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]
<?php $category = get_the_category(); echo $category[0]->cat_name;?>
[/php]

Good luck.

What's your reaction?
0Smile0Lol0Wow0Love0Sad0Angry

Leave a comment