WordPress.org

Ready to get started?Download WordPress

Codex

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

Function Reference/single tag title

Contents

Description

Displays or returns the tag title for the current archive page.

Usage

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

Default Usage

 <?php single_tag_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 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

Source File

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

Related

Tags: get_tag(), get_tag_link(), get_tags(), get_the_tag_list(), get_the_tags(), is_tag(), the_tags(), single_tag_title(), tag_description(), wp_generate_tag_cloud(), wp_tag_cloud()

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