Created
May 19, 2013 02:21
-
-
Save iscat/5606420 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* wp_title() expand | |
https://gist.github.com/mcatm/5113723 | |
---------------------------------- */ | |
function wp_title_expand($str = null) { | |
global $page, $paged; | |
$str .= (!$str) ? get_bloginfo('name') : ' - '.get_bloginfo('name'); | |
$site_description = get_bloginfo('description', 'display'); | |
if ($site_description && (is_home() || is_front_page())) $str .= ' - '.$site_description; | |
if ($paged >= 2 || $page >= 2) $str .= ' - ' . sprintf(__('Page %s'), max($paged, $page)); | |
return $str; | |
} | |
add_filter('wp_title', 'wp_title_expand'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment