|
@@ -26,17 +26,39 @@ function page_bodyclass() {
|
|
|
}
|
|
|
endif;
|
|
|
|
|
|
-if ( ! function_exists( 'dw_page_title') ) :
|
|
|
-function dw_page_title() {
|
|
|
- global $page, $paged;
|
|
|
- wp_title( '|', true, 'right' );
|
|
|
- bloginfo( 'name' ); $site_description = get_bloginfo( 'description', 'display' );
|
|
|
- if ( $site_description && ( is_home() || is_front_page() ) )
|
|
|
- echo " | $site_description";
|
|
|
- if ( $paged >= 2 || $page >= 2 )
|
|
|
- echo ' | ' . sprintf( __( 'Page %s', 'dw' ), max( $paged, $page ) );
|
|
|
+// ********* DEPRECIATED wp_title in 4.4 ***********
|
|
|
+//if ( ! function_exists( 'dw_page_title') ) :
|
|
|
+//function dw_page_title() {
|
|
|
+// global $page, $paged;
|
|
|
+// wp_title( '|', true, 'right' );
|
|
|
+// bloginfo( 'name' ); $site_description = get_bloginfo( 'description', 'display' );
|
|
|
+// if ( $site_description && ( is_home() || is_front_page() ) )
|
|
|
+// echo " | $site_description";
|
|
|
+// if ( $paged >= 2 || $page >= 2 )
|
|
|
+// echo ' | ' . sprintf( __( 'Page %s', 'dw' ), max( $paged, $page ) );
|
|
|
+//}
|
|
|
+//endif;
|
|
|
+
|
|
|
+function filter_wp_title( $title, $sep ) {
|
|
|
+ global $paged, $page;
|
|
|
+
|
|
|
+ if ( is_feed() )
|
|
|
+ return $title;
|
|
|
+
|
|
|
+ $title .= get_bloginfo( 'name' );
|
|
|
+
|
|
|
+ $site_description = get_bloginfo( 'description', 'display' );
|
|
|
+ if ( $site_description && ( is_home() || is_front_page() ) )
|
|
|
+ $title = "$title $sep $site_description";
|
|
|
+
|
|
|
+ if ( $paged >= 2 || $page >= 2 )
|
|
|
+ $title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
|
|
|
+
|
|
|
+ return $title;
|
|
|
}
|
|
|
-endif;
|
|
|
+add_filter( 'wp_title', 'filter_wp_title', 10, 2 );
|
|
|
+add_filter( 'document_title_separator', function () { return '|'; } );
|
|
|
+
|
|
|
|
|
|
if ( ! function_exists( 'dw_meta_desc') ) :
|
|
|
function dw_meta_desc() {
|