Changing WordPress Title Formats

I fixed the title formats on here today.  Not especially noteworthy, but I wanted to make a small post about it for my own reference.

So, the change I wanted to make was to make appear after the post title.  In this theme’s header.php, there is a line like this:

<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>

I swapped the postition of wp_title and bloginfo(‘name’), but then I had the separator (») at the beginning of the title.  Well, it turns out wp_title will take whatever you put into it, and append it to the title.  If nothing is passed, it automatically uses ».  So I changed that, and you can choose the location where it is appended.  So, here is mine:

<?php wp_title(' | ',true,'right'); ?>

Which puts a nice | between the title name and my blog name, which is now after the post name.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>