Well, I thought I'd share. Don't know how helpful this is, but with this query, I can have a custom link setup - a sort of "tag archive". My setup is such that the site is using WordPress as a CMS, and we're using the tagging system as a sort of "newsletter" assistance. So at the end of each post, they "tag" the post with what month and year they want the article to appear in. So as the site gets used, multiple tags will be added, and I wanted an archive list that I didn't have to update every month. So this is what I did - hope it helps someone else :)
<ul id="newsletter">
<?php $get_tags = ("SELECT $wpdb->term_taxonomy.*, $wpdb->terms.*
FROM $wpdb->term_taxonomy, $wpdb->terms
WHERE $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id
AND $wpdb->term_taxonomy.taxonomy = 'post_tag'
ORDER BY $wpdb->terms.term_id
ASC");
$tagquery = $wpdb->get_results($get_tags);
if ( $tagquery ) {
foreach ( $tagquery as $gt ) {
$tagid = $gt->term_id;
$tagslug = $gt->slug;
$tagname = $gt->name
?>
<li><a href="<?php echo get_tag_link($tagid);?>"><?php echo $tagname; ?></a> </li>
<?php
}
}
?>
</ul>
That little piece of code will look for tags in the database and return them - name, ID and slug, and create a "links list" for them.
Like I said, hope it helps someone else!