hi,the default title format of the theme is Post Name|Site Name,how to change it to Post Name|Category Name|Site Name? And also when page lists ,make the title show Post Name – Page Count|Category Name|Site Name.
This is better for SEO and I am not very happy with ALL IN ONE SEO,so pls help. Thank you.
-
This topic was modified 11 years by
winnieji.
I already had this code below which can have the page number on title when there are page lists:
<title><?php
global $page, $paged;
$site_description = get_bloginfo( 'description', 'display' );
if ($site_description && ( is_home() || is_front_page() )) {
bloginfo('name');
echo " - $site_description";
} else {
echo trim(wp_title('',0));
if ( $paged >= 2 || $page >= 2 )
echo ' - ' . sprintf( __( '第%s页' ), max( $paged, $page ) );
echo ' | ' ;
bloginfo('name');
}
?></title>
But don’t know how to make the title echo category name.
-
This reply was modified 11 years by
winnieji.
When I used to do my own WordPress themes, I’d put in all the applicable coding and format in the header.php file and QED. However with modern themes with different kinds of headers, customizations, theme panels, etc., it can be a pain in the butt.
Frankly, I just use the Yoast WordPress SEO plugin the past 2 years, and this has worked perfectly for exactly what you’re trying to do. Really. If you only use it for that, it works very well. 🙂
Thank you for the reply ChriS.But for me I only want to rewrite the title, using seo plugin is a so much waste. And,I don’t like that plugin:).I don’t think it is better for SEO than simply messing with <title> </title> in header.
-
This reply was modified 11 years by
winnieji.