A WordPress-centric search engine for devs and theme authors



the_title ›

Since0.71
Deprecatedn/a
the_title ( $before = '', $after = '', $echo = true )
Parameters: (3)
  • (string) $before Optional. Markup to prepend to the title. Default empty.
    Required: No
    Default: (empty)
  • (string) $after Optional. Markup to append to the title. Default empty.
    Required: No
    Default: (empty)
  • (bool) $echo Optional. Whether to echo or return the title. Default true for echo.
    Required: No
    Default: true
Returns:
  • (string|void) Current post title if $echo is false.
Defined at:
Codex:

Display or retrieve the current post title with optional markup.



Source

function the_title( $before = '', $after = '', $echo = true ) {
	$title = get_the_title();

	if ( strlen($title) == 0 )
		return;

	$title = $before . $title . $after;

	if ( $echo )
		echo $title;
	else
		return $title;
}