Ok, no reply, I came up with the following that actually works (in case anyone is looking for it):
function get_related_tags($tagname) {
global $wpdb;
$sqlstring="select name from $wpdb->terms where term_id in (" .
"select term_id from $wpdb->term_taxonomy where taxonomy=\"post_tag\" and term_taxonomy_id in (" .
"select distinct term_taxonomy_id from $wpdb->term_relationships where object_id in (" .
"select object_id from $wpdb->term_relationships where term_taxonomy_id =" .
"(select term_taxonomy_id from $wpdb->term_taxonomy where term_id=" .
"(select term_id from $wpdb->terms where name=\"".$tagname."\")))))";
$tagidarray = $wpdb->get_col($sqlstring,0);
$returnRelatedTagDiv='';
foreach($tagidarray as $relatedtag) {
if ($relatedtag != $tagname) {
$returnRelatedTagDiv .= "<a href=\"/about/" . $relatedtag . "\">";
$returnRelatedTagDiv .= $relatedtag;
$returnRelatedTagDiv .= "</a> ";
$tagid = fetch_tag_id($relatedtag);
//$returnRelatedTagDiv .= fetch_tag_amount($tagid);
$returnRelatedTagDiv .= "";
}
}
return $returnRelatedTagDiv;
}
as documented on http://edward.de.leau.net/wordpress-retrieve-the-set-of-tags-used-with-another-tag-20081110.html
This is actually a hefty query so I wonder if it can be done better.
Another thing... what would happen if I click a tag. then I come to the tag page of the tag with ALL postings. However I would then like to come to the tag page archive of the tag but with only the postings of the tag that I clicked on before... does anyone understand?
A sort of refining query on tags.