WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/single term title

Contents

Description

Displays or returns the term title for the current page.

Usage

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

Default Usage

 <?php single_term_title(); ?> 

Parameters

$prefix
(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

$display
(boolean) (optional) Display the title (TRUE), or return the title to be used in PHP (FALSE).
Default: TRUE

Examples

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

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


This example assigns the current term title to the variable $current_term for use in PHP.

<?php $current_term = single_term_title("", false); ?>

Change Log

Source File

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

Related

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