How to display WordPress Category Without the link

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.

Leave a reply

0
Connecting
Please wait...
Send a message

Sorry, we aren't online at the moment. Leave a message.

Your name
* Email
* Describe your issue
Chat now

Need more help? Save time by starting your support request online.

Your name
* Email
* Describe your issue
We're online! Ask us anything!
Feedback

Help us help you better! Feel free to leave us any additional feedback.

How do you rate our support?