Copied from Plug-in Forum:
Hi believein – I’m not sure I understand what you mean.
On your post tag archive, which lists posts with some tag, you would like to list events which are tagged with that tag?
This is possible – but remember the event tag is not the same as your post tags. What you would have to do is get the slug of the tag you are viewing (on your post tag archive page) and then perform a second query to list events with the same ‘event tag’ name (It’s technically not the same tag since they are different taxonomies….).
This is all generic WP stuff, on you archive.php (or what ever template you use for your post-tag archive) you can get the current tag being queried as follows:
Note: This is completely untested, more ‘proof of concept’ 🙂
if( is_tag() ){
$tag = get_queried_object();
$tag_name = $tag->term_name; //Or it might be $tag->name;
//Get corresponding event tag by NAME as SLUG may be different
//WP doesn't always like different terms having same slug even if
// they are in seperate taxonomies,
$event_tag = get_term_by('name', $tag_name, 'event-tag');
//Perform Query for events with that tag here, loop through results and display
}else{
//A tag is not being viewed - don't do anything.
}
The query would be:
$event_query = new WP_Query(array(
'post_type'=>'event',
'tax_query' => array(
array(
'taxonomy' => 'event-tag',
'field' => 'slug',
'terms' => $event_tag->slug
)),
));
(and any other query paramters you want to include (see eo_get_events for available parameters). See also WP documentation on WP_Query.