the_title( string $before = '', string $after = '', bool $echo = true )

Display or retrieve the current post title with optional markup.

Description Description

Parameters Parameters


(string) (Optional) Markup to prepend to the title.

Default value: ''


(string) (Optional) Markup to append to the title.

Default value: ''


(bool) (Optional) Whether to echo or return the title. Default true for echo.

Default value: true

Top ↑

Return Return

(string|void) Current post title if $echo is false.

Top ↑

Source Source

File: wp-includes/post-template.php

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

	if ( strlen($title) == 0 )

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

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

Top ↑

Changelog Changelog

Version Description
0.71 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.