WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/single post title

Contents

Description

Displays or returns the title of the post when on a single post page (permalink page). This tag can be useful for displaying post titles outside The Loop.

Usage

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

Default Usage

 <?php single_post_title(); ?> 

Parameters

$prefix
(string) (optional) Text to place 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) Should the title be displayed (TRUE) or returned for use in PHP (FALSE).
Default: TRUE

Example

<h2><?php single_post_title('Current post: '); ?></h2>
Current post: Single Post Title

Related

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