the_title() – Display or retrieve the current post title with optional markup.
You appear to be a bot. Output may be restricted
Description
Displays or retrieves the current post title with optional markup.
Usage
$void|string = the_title( $before, $after, $echo );
Parameters
- $before
- ( string ) optional – Optional. Markup to prepend to the title. Default empty.
- $after
- ( string ) optional – Optional. Markup to append to the title. Default empty.
- $echo
- ( bool ) optional default: 1 – Optional. Whether to echo or return the title. Default true for echo.
Returns
void|string Void if $echo
argument is true, current post title if $echo
is false.
Source
File name: wordpress/wp-includes/post-template.php
Lines:
1 to 15 of 15
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; } }