Optimal title (without plugin)?

Published: On Tuesday, July 24, 2007

Well, finally I have come before the question How to make title more user- (& SEO-) friendly? and the for the answer I didn't have to „wait“ too long :-). Read this:

<title><?php
  echo ( $title = wp_title('', false) ) ? $title . ' | ' : '';
  bloginfo('name'); ?></title>

Although I think it's relatively clear (what the code does), I describe it on the result:

  • On the homepage your title will be: My blog
  • On the article-page (or Page-page): The article | My blog
  • And so on: The Category | My blog, Monthuary 2007 | My blog
I'm quite sure that with this code will become Optimal title plugin unnecessary.

Useful? Bookmark or share:

  • email
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Propeller
  • Twitter

Comments

  1. 1.  sonika wrote: On August 31., 2007 comment number 1

    Cool code, thanks a lot!

Add a comment