Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #176 from mamhoff/master
Browse files Browse the repository at this point in the history
fix wp_title() so it behaves just like the standard wp themes
  • Loading branch information
chrisbarnes committed Jun 13, 2014
2 parents c772c06 + 78f2d0e commit a73236a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions functions.php
Expand Up @@ -484,4 +484,30 @@ function theme_js(){
}
add_action( 'wp_enqueue_scripts', 'theme_js' );

// Get <head> <title> to behave like other themes
function wp_bootstrap_wp_title( $title, $sep ) {
global $paged, $page;

if ( is_feed() ) {
return $title;
}

// Add the site name.
$title .= get_bloginfo( 'name' );

// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) ) {
$title = "$title $sep $site_description";
}

// Add a page number if necessary.
if ( $paged >= 2 || $page >= 2 ) {
$title = "$title $sep " . sprintf( __( 'Page %s', 'wpbootstrap' ), max( $paged, $page ) );
}

return $title;
}
add_filter( 'wp_title', 'wp_bootstrap_wp_title', 10, 2 );

?>

0 comments on commit a73236a

Please sign in to comment.