the_title

Definition:
function the_title($before = '', $after = '', $echo = true) {}

Display or retrieve the current post title with optional content.

Parameters

  • string $before: Optional. Content to prepend to the title.
  • string $after: Optional. Content to append to the title.
  • bool $echo: Optional, default to true.Whether to display or return.

Return values

returns:Null on no title. String if $echo parameter is false.

Source code

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;

}

3051

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: