Codex

Template Tags/single tag title

Contents

Description

Displays or returns the tag title for the current page.

Usage

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

Default Usage

 <?php single_tag_title(
    
'prefix'   => 
    
'display'  => true ); ?> 

Parameters

$prefix
(string) (optional) Text to output before the title.
Default: None
$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 tag title.

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


This example assigns the current tag title to the variable $current_tag for use in PHP.

<?php $current_tag = single_tag_title("", false); ?>

Change Log

Since: 2.3.0

Related

the_tags, tag_description, single_tag_title, wp_tag_cloud, wp_generate_tag_cloud, get_tags, get_the_tags, get_the_tag_list, get_tag_link

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