Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/single cat title


Displays or returns the page title if a category or tag archive is queried. Therefore, the function can be used only outside the loop.


 <?php single_cat_title$prefix$display ); ?> 

Default Usage

<?php single_cat_title( '', true ); ?>


(string) (optional) Text to output before the title.
Default: None

Note: The $prefix argument is currently ignored if the $display argument is false.
See http://core.trac.wordpress.org/ticket/16632

(boolean) (optional) Should the page title be displayed (true) or returned for use in PHP (false).
Default: true

Return Values

Page title if a category or tag archive is queried and the $display argument is set to false.


This example displays the text "Currently browsing " followed by the category title.

<p><?php single_cat_title('Currently browsing '); ?>.</p>
Currently browsing WordPress.

This example assigns the current category title to the variable $current_category for use in PHP.

<?php $current_category = single_cat_title("", false); ?>


Change Log

Since: Version 0.71

Source File

single_cat_title() is located in wp-includes/general-template.php.


See also index of Function Reference and index of Template Tags.