wp_title is WP funtion that displays or returns the title of the page. A separator string can be defined and it can be designated to print before or after the title of the page.
This tag can be used anywhere within a template as long as it’s outside The Loop on the main page, though is typically used in the
Usage
Parameters
$sep
(string) (optional) Text to display before or after
of the post title (i.e. the separator). By default
(if sep is blank) then the » (») symbol will
be placed before or after (specified by the seplocation)
the post title.
Default: » (»)
1 (True) - default
0 (False)
$echo
(boolean) (optional) Echo the title (True) or
return the title for use as a PHP string (False).
Default: True
$seplocation
(string) (optional) Introduced with Version 2.5,
this parameter defines the location of where the
sep string prints in relation to the title of the post.
For all values except 'right', the sep value is placed
in front of (to the left of) the post title. If the value
of seplocation is 'right' then the sep string will be
appended after the post title.
Default: None
Return values
None.
Examples
Separator with Blog Name
Title Reversed
This lets you reverse page title and blog name in the title tag from example above
(Hello world!–My WordPress Blog) by removing the separator (using wp_title(‘ ‘),
then tests if there is a post title (using if(wp_title(‘ ‘, false))), and displays the separator
between it and bloginfo() if it does.
More info: http://codex.wordpress.org/Function_Reference/wp_title



Leave a comment