• Resolved Chris_K

    (@handysolo)


    Clicking a tag in 2.3 will take us to a listing of posts for that tag. When I’m on that listing (I’m using tag.php), how do I discern what tag the listing is for? I’d like to include it in my <title>.

    With UTW, I had something like this in my header.php:

    <title>
    	<?php if (is_tag()) { ?>
    		<?php echo 'Articles tagged with: '; ?>
    		<?php UTW_ShowCurrentTagSet('tagsettextonly'); ?>
    		<?php echo ' &raquo; '; ?>
    		<?php bloginfo('name'); ?>
    	<?php } else { ?>
    		<?php wp_title(''); ?>
    		<?php if(wp_title('', false)) { echo ' &raquo; '; } ?>
    		<?php bloginfo('name'); ?>
    	<?php } ?>
    </title>

    Any thoughts on how to replace that UTW_ShowCurrentTagSet() call?

    I guess the same could apply to meta for single pages as well. How to grab these critters out of The_Loop?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try single_tag_title(). No Codex docs at this time.

    Thread Starter Chris_K

    (@handysolo)

    Thanks! That works delightfully.

    Thread Starter Chris_K

    (@handysolo)

    For posterity’s sake (and searching since I forget things):

    <title>
    	<?php if (is_tag()) { ?>
    		<?php echo 'Articles tagged with: '; ?>
    		<?php single_tag_title(); ?>
    		<?php echo ' &raquo; '; ?>
    		<?php bloginfo('name'); ?>
    	<?php } else { ?>
    		<?php wp_title(''); ?>
    		<?php if(wp_title('', false)) { echo ' &raquo; '; } ?>
    		<?php bloginfo('name'); ?>
    	<?php } ?>
    </title>

    Sorry, but this does not solve the problem!

    Unfortunatelly the wp_title(”) only outputs one tag.

    Like URL /tag/foo/ gives the output foo.
    But URL /tag/foo+bar/ also gives only foo.

    So right now there seems to be no propper replacement for UTW_ShowCurrentTagSet

    Any ideas?

    BTW: wp_title() does the same (wrong thing) as single_tag_title()

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘What Tag Page am I on?’ is closed to new replies.