[wp-testers] getting a tag name w/o the loop

DD32 wordpress at dd32.id.au
Thu Aug 9 08:22:53 GMT 2007


On Thu, 09 Aug 2007 17:59:40 +1000, Paul Stamatiou <p at pstam.com> wrote:

> Hi, I just co'd trunk, converted my categories to tags and am
> converting my theme to support tags. I'm trying to find out how to get
> a tag name without it being in the loop.
>
> For example, on a page like http://paulstamatiou.com/tags/news/, I
> would have "posts in the <tagname> tag". I have gone through
> category-template.php and tried several tag functions without luck. Is
> this possible without needing to be in the loop. Basically I'm trying
> to find a replacement for what I used to use:
>
>  if (is_category()) { ?>		
> Posts in the '<?php echo single_cat_title(); ?>' category

You'd still use that, Sounds stupid, but seems thats the way its done,  
 From the default theme: archive.php
  <?php /* If this is a category archive */ if (is_category()) { ?>
	<h2 class="pagetitle">Archive for the &#8216;<?php single_cat_title();  
?>&#8217; Category</h2>
   <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
	<h2 class="pagetitle">Posts Tagged &#8216;<?php single_cat_title();  
?>&#8217;</h2>

> Also, slightly unrelated, I can't seem to get
> wp_tag_cloud('exclude=uncategorized') to exclude 'uncategorized'.

I think it excludes by ID rather than by name.., But looking at it, it  
doesnt seem it actually references to exclude anywhere anyway, So you cant  
exclude it.
What were you hoping to do here? Exclude the tag 'uncategorized' from  
showing up? excluding tags on posts in the category 'uncategorized'?
-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the wp-testers mailing list