wordpress SEO 标题设置

一行代码解决所有页面标题

1
<?php if(is_single()){single_post_title();echo bloginfo('name');}elseif(is_home()||is_front_page()){echo bloginfo('name');$paged = get_query_var('paged'); if($paged>1) printf('–第%s页',$paged);echo '-'.bloginfo('name');}elseif(is_page()){single_post_title(''); echo ' | ';echo bloginfo('name');}elseif(is_search()){printf( __('Search results for "%s"','iLost'),esc_html($s));echo ' | ';echo bloginfo('name');}elseif(is_404()){echo '你访问的页面不存在';echo ' | ';echo bloginfo('name');}else{wp_title('');}?>-<?php bloginfo('description'); ?>