Put wordpress title inside variable
Any idea how to make this work?
$title = wp_title();
The problem is wordpress automatically echoes the wp_ti开发者_如何学运维tle();
Any ideas?
Have you even looked @ the Wordpress documentation? Its right here: http://codex.wordpress.org/Function_Reference/wp_title
use it like so:
<?php wp_title( $sep, $echo, $seplocation ); ?>
where $echo
is boolean (true/false)
$echo (boolean) (optional) Echo the title (True) or return the title for use as a PHP string (False).
Default: True
* 1 (True) - default
* 0 (False)
$title = wp_title('', 0);
精彩评论