Deprecated. Modify head wp title.
This function is deprecated since it was replaced by the ‘title-tag’ theme support.
beans_wp_title( string $title, string $sep )
Return: (string) The modified title.
Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
$title | string | true | - | The WordPress default title. |
$sep | string | true | - | The title separator. |
Source
function beans_wp_title( $title, $sep ) {
_deprecated_function( __FUNCTION__, '1.2.0', 'wp_title()' );
global $page, $paged;
if ( is_feed() ) {
return $title;
}
// Add the blog name.
$title .= get_bloginfo( 'name' );
// Add the blog description for the home/front page.
if ( ( $site_description = get_bloginfo( 'description', 'display' ) ) && ( is_home() || is_front_page() ) ) {
$title .= " $sep $site_description";
}
// Add a page number if necessary.
if ( $paged >= 2 || $page >= 2 ) {
$title .= " $sep " . sprintf( __( 'Page %s', 'tm-beans' ), max( $paged, $page ) );
}
return $title;
}