wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



the_title › WordPress Function

Da0.71
Deprecaton/a
the_title ( $before = '', $after = '', $display = true )
Parametri: (3)
  • (string) $before Optional. Markup to prepend to the title. Default empty.
    Richiesto: No
    Default: (vuoto)
  • (string) $after Optional. Markup to append to the title. Default empty.
    Richiesto: No
    Default: (vuoto)
  • (bool) $display Optional. Whether to echo or return the title. Default true for echo.
    Richiesto: No
    Default: true
Ritorna:
  • (void|string) Void if `$display` argument is true or the title is empty, current post title if `$display` is false.
Definito a:
Codex:

Displays or retrieves the current post title with optional markup.



Sorgenti

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

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

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

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