Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Kyle Krafka (March 15, 2013)
- function pinboard_doc_title( $doc_title ) {
- global $page, $paged;
- $doc_title = str_replace( '» ', '', $doc_title ); // Notice the added space after »
- $site_description = get_bloginfo( 'description', 'display' );
- $separator = '|'; // | ... I brought the & and ; into the $separator string
- if ( is_front_page() ) {
- // Display the title of the website, regardless of the page title
- $doc_title = get_bloginfo( 'name' );
- if ( $site_description )
- // And the site description if there is one, though this may look like the rest of the pages, only flipped around the |
- $doc_title .= ' ' . $separator . ' ' . $site_description;
- } else {
- // For every other page, use "Page | Site Name" (and page number, if appropriate)
- if ( $paged >= 2 || $page >= 2 )
- $doc_title .= ', ' . __( 'Page', 'pinboard' ) . ' ' . max( $paged, $page );
- $doc_title .= ' ' . $separator . ' ' . get_bloginfo('name');
- }
- return $doc_title;
- }
- // Compare to the original:
- function pinboard_doc_title( $doc_title ) {
- global $page, $paged;
- $doc_title = str_replace( '»', '', $doc_title );
- $site_description = get_bloginfo( 'description', 'display' );
- $separator = '#124';
- if ( is_singular() ) {
- if( is_front_page() )
- $doc_title .= get_the_title();
- if ( $paged >= 2 || $page >= 2 )
- $doc_title .= ', ' . __( 'Page', 'pinboard' ) . ' ' . max( $paged, $page );
- } else {
- if( ! is_home() )
- $doc_title .= ' &' . $separator . '; ';
- $doc_title .= get_bloginfo( 'name' );
- if ( $paged >= 2 || $page >= 2 )
- $doc_title .= ', ' . __( 'Page', 'pinboard' ) . ' ' . max( $paged, $page );
- }
- if ( ( is_home() ) && $site_description )
- $doc_title .= ' &' . $separator . '; ' . $site_description;
- return $doc_title;
- }
Advertisement
Add Comment
Please, Sign In to add comment