Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'after_setup_theme', 'z1_turnoff_twentytwelve_title' );
- function z1_turnoff_twentytwelve_title() {
- remove_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );
- }
- add_filter( 'wp_title', 'z1_twentytwelve_wp_title', 10, 2 );
- function z1_twentytwelve_wp_title( $title, $sep ) {
- global $paged, $page;
- if ( is_feed() )
- return $title;
- //strip out separator already added by wp_title()
- $title = str_replace( $sep, '', $title);
- // Add the site description for the home/front page.
- $site_description = get_bloginfo( 'description', 'display' );
- if ( $site_description && ( is_home() || is_front_page() ) )
- $title = "$site_description";
- // Add a page number if necessary.
- if ( $paged >= 2 || $page >= 2 )
- $title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
- // Add the site name before the other stuff.
- $title = get_bloginfo( 'name' ) . ' ' . $sep . ' ' . $title;
- return $title;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement