[wp-testers] getting a tag name w/o the loop
Paul Stamatiou
p at pstam.com
Thu Aug 9 09:06:26 GMT 2007
I was looking at how the K2 theme does it, but I think it has its own system
} elseif (function_exists('is_tag') and is_tag()) {
printf(__('Tag Archive for \'%s\'','k2_domain'), get_query_var('tag') );
unless get_query_var() is part of WP that I'm not aware of?
P
On 8/9/07, DD32 <wordpress at dd32.id.au> wrote:
> Seems your right, It simply displays "Posts Tagged ''" for me too on the
> default theme.
>
> Looks like we're in need of a fair few new tag template functions and
> modifications to the current tag cloud.
>
> On Thu, 09 Aug 2007 18:56:08 +1000, Paul Stamatiou <p at pstam.com> wrote:
>
> > Thanks for the info. Unfortunately single_cat_tag() doesn't output
> > anything for me. As for the tag cloud, I had converted all of my
> > categories to tags (I wont run categories anymore) and just wanted to
> > exclude the 'uncategorized' tag from the cloud. The uncategorized tag
> > also 404s so I have no idea what is even uncategorized anymore.
> >
> > This is the top of my theloop.php, fairly similar to the code you posted:
> >
> > <?php if(have_posts()){
> > $post = $posts[0];
> > if(!is_single() && !is_home() or is_paged()){?>
> > <div class="pagetitle">
> > <h2>
> >
> > <?php if (is_tag()) { ?>
> > Posts tagged '<?php single_cat_title(); ?>'
> >
> > <?php } elseif (is_day()) { ?>
> > Archive for <?php the_time('F jS, Y'); ?>
> >
> >
> > On 8/9/07, DD32 <wordpress at dd32.id.au> wrote:
> >> 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 ‘<?php
> >> single_cat_title();
> >> ?>’ Category</h2>
> >> <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
> >> <h2 class="pagetitle">Posts Tagged ‘<?php
> >> single_cat_title();
> >> ?>’</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/
> >> _______________________________________________
> >> wp-testers mailing list
> >> wp-testers at lists.automattic.com
> >> http://lists.automattic.com/mailman/listinfo/wp-testers
> >>
> >
> >
>
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
>
--
Paul Stamatiou
Computational Media
Georgia Tech in Atlanta, GA
PaulStamatiou.com
More information about the wp-testers
mailing list