Title: show category in single.php
Last modified: August 24, 2016

---

# show category in single.php

 *  [f.perez87](https://wordpress.org/support/users/fperez87/)
 * (@fperez87)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/show-category-in-singlephp/)
 * Hello, I’m trying to get the category in a string var and i’m not being able 
   to do it. the_category() shows the category, but I cannot get it as a string.
   please help me.
 * thank you!

Viewing 1 replies (of 1 total)

 *  [saturdie](https://wordpress.org/support/users/saturdie/)
 * (@saturdie)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/show-category-in-singlephp/#post-6008040)
 * Hi f.perez.
 * Maybe:
    <?php
 * $nameofvariable = the_category()
 * ?>
 * Its only a idea, i dont know if it work.

Viewing 1 replies (of 1 total)

The topic ‘show category in single.php’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/colorway/4.2.3/screenshot.png)
 * ColorWay
 * [Support Threads](https://wordpress.org/support/theme/colorway/)
 * [Active Topics](https://wordpress.org/support/theme/colorway/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/colorway/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/colorway/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [saturdie](https://wordpress.org/support/users/saturdie/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/show-category-in-singlephp/#post-6008040)
 * Status: not resolved