0
votes

Simple question. I'm creating a wordpress theme and I want to display the post category name inside a <h1> tag.

If I used the_category(""); wordpress outputs a linkable category name.

Since I'm already on that categories page, I don't want the category name to be linkable, instead, I only want it displayed as plain text.

Any help would be appreciated

2
tip: wordpress.stackexchange.com is the place for WordPress Questions!edelwater

2 Answers

1
votes

use <?php single_cat_title( ); ?>

you can see doc here http://codex.wordpress.org/Function_Reference/single_cat_title

0
votes

get_the_category() will get you all the post's categories:

Returns an array of objects, one object for each category assigned to the post. This tag may be used outside The Loop by passing a post id as the parameter.

as a general rule in the Wordpress Codex, get_xyz() will return the value, where xyz() will output it.