Kreativ Font - Kreativ Sound - Kreativ Theme

WordPress Codex: wp_title()

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 element for the head of a page.</p> <p><strong>Usage</strong><br /> <code><?php wp_title( $sep, $echo, $seplocation ); ?></code></p> <p><strong>Parameters</strong><br /> <code>$sep<br /> (string) (optional) Text to display before or after<br /> of the post title (i.e. the separator). By default<br /> (if sep is blank) then the » (») symbol will<br /> be placed before or after (specified by the seplocation)<br /> the post title.<br /> Default: » (»)<br /> 1 (True) - default<br /> 0 (False)<br /> $echo<br /> (boolean) (optional) Echo the title (True) or<br /> return the title for use as a PHP string (False).<br /> Default: True</p> <p>$seplocation<br /> (string) (optional) Introduced with Version 2.5,<br /> this parameter defines the location of where the<br /> sep string prints in relation to the title of the post.<br /> For all values except 'right', the sep value is placed<br /> in front of (to the left of) the post title. If the value<br /> of seplocation is 'right' then the sep string will be<br /> appended after the post title.<br /> Default: None<br /> Return values<br /> None.</code></p> <p><strong>Examples</strong><br /> Separator with Blog Name<br /> <code><title><br /> <?php wp_title('|',true,'right'); ?><br /> <?php bloginfo('name'); ?><br />

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.

<br /> <?php wp_title(' '); ?><br /> <?php if(wp_title(' ', false)) { echo '|'; } ?><br /> <?php bloginfo('name'); ?><br />

More info: http://codex.wordpress.org/Function_Reference/wp_title

Leave a comment

or Subscribe to this comment feed via RSS