Another Run at WordPress <title> Tags
Posted on January 18, 2007
3 Comments
Had an interesting question pop up at the WordPress support forums today. The person was wondering how to incorporate tag names (from the Ultimate Tag Warrior plugin) into page titles.
When I saw the question, I recalled stumbling over the is_tag() function once before. A quick web search turned up an article at The Zero Boss that looked pretty helpful.
However, I didn't quite like his title style (nor did I want to retitle all of my existing indexed pages!) so I adapted his style into my style and ended up with this:
-
<title>
-
<?php if (is_tag()) { ?>
-
<?php UTW_ShowCurrentTagSet('tagsettextonly'); ?>
-
<?php bloginfo('name'); ?>
-
<?php } else { ?>
-
<?php wp_title(''); ?>
-
<?php bloginfo('name'); ?>
-
<?php } ?>
-
</title>
Clicking on one of my tags will get a page titled "Articles tagged with: tagName » Solo Technology". Before, the title for those pages was simply "Solo Technology", so when looking at analytics I had to look deeper to figure out when tag pages were being hit.
Nifty?
Tags: blog, SEO, title, ultimate-tag-warrior, WordPress
Possibly Related Posts
Comments
3 Responses to “Another Run at WordPress <title> Tags”
Leave a Reply



Very cool.
Glad the writeup was helpful!
Thanks man - your article was just the ticket to nudge me along!