Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

User:Yami McMoots/My Header

So the behavior of wp_title() isn't optimized for Googliciousness. Here's how I have my page title set up in header.php:

<title>
<?php if (is_home () ) { 
	  bloginfo('name'); 
	} elseif ( is_category() ) { 
	  bloginfo('name'); echo ": "; single_cat_title(); 
	} elseif (is_single() || is_page() ) { 
	  single_post_title();
	} elseif (is_search() ) {
	  bloginfo('name'); echo " search results: "; echo wp_specialchars($s);
	} else { wp_title(,true); } 
?>
</title>