Feb 23, 2007

Wordpress Hacking for Better Blog Titles

Here is a quick tip for any Wordpress users frustrated at the crappy default page titles you get with most templates. I got asked yesterday how I changed mine and if I used a plugin. No, it’s way easier than that.

Go into your Wordpress admin and navigate to Presentation then Theme Editor. You need to edit your Header template. Find the Title tags. Replace with the following:


title...?php // if is the homepage, display // just the blog name // otherwise use the post title if(is_home()) { echo bloginfo('name'); } else { wp_title(''); echo ' : '; echo bloginfo('name'); } ?..title



What this code will do is display your blog name (set in options) for the homepage, otherwise your post title (or archives, whatever) followed by your blog name.

If you want to display something other than your blog name replace “bloginfo('name')” with the text of your choice surrounded by quotes, eg.

echo "Chris is fantastic";

That’s all there is to it really. Let me know if I haven’t made this clear.


**(apply on tag "title" with <...> and closed by )

*This article taken from http://www.chrisg.com

Related Posts




0 comments:

Post a Comment

Google