wp_title

SummerySummery

Display or retrieve page title for all areas of blog.

Syntax

wp_title( string $sep = '»', bool $display = true, string $seplocation = '' )

DescriptionDescription

By default, the page title will display the separator before the page title, so that the blog title will be before the page title. This is not good for title display, since the blog title shows up on most tabs and not what is important, which is the page that the user is looking at.

There are also SEO benefits to having the blog title after or to the ‘right’ of the page title. However, it is mostly common sense to have the blog title to the right with most browsers supporting tabs. You can achieve this by using the seplocation parameter and setting the value to ‘right’. This change was introduced around 2.5.0, in case backward compatibility of themes is important.

ParametersParameters

$sep

(string) (Optional) default is '»'. How to separate the various items within the page title.

Default value: '»'

$display

(bool) (Optional) Whether to display or retrieve title.

Default value: true

$seplocation

(string) (Optional) Location of the separator ('left' or 'right').

Default value: ''

ReturnReturn

(string|null) String on retrieve, null when displaying.

SourceSource

File: wp-includes/general-template.php


			

ChangelogChangelog

Changelog
Version Description
1.0.0 Introduced.
Scroll to Top