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?
Possibly Related posts:




Very cool.
Glad the writeup was helpful!
Thanks man – your article was just the ticket to nudge me along!
[...] to my liking. I also modified the index.php to display my asides style too. And of course, my own title style. Busy busy [...]