WordPressthe_title()


Introduction

This function returns the title of the current post.

Syntax

  • the_title( $before, $after, $echo );

Parameters

ParameterDetails
$before(string) (optional) Text to place before the title.
$after(string) (optional) Text to place after the title.
$echo(Boolean) (optional) Display the title or return it for use in PHP

Remarks

  • For the parameter $echo, use true to display the title and use false to return it for use in PHP
  • Please note that the_title can only be used in loops, if you want to use it outside of loops, please use get_the_title