Warning: Trying to access array offset on value of type bool in /home/graphicxtreme/public_html/wp-content/plugins/visual-footer-credit-remover/visual-footer-credit-remover.php on line 89

Warning: Trying to access array offset on value of type bool in /home/graphicxtreme/public_html/wp-content/plugins/visual-footer-credit-remover/visual-footer-credit-remover.php on line 90

Warning: Trying to access array offset on value of type bool in /home/graphicxtreme/public_html/wp-content/plugins/visual-footer-credit-remover/visual-footer-credit-remover.php on line 91

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.

, ,