Using get_terms I've created three lists of term links. What currently happens if I click on a term is to see the archive for that term, what I'm attempting to achieve now is when I click a second term I want to see an archive for both terms not just the latest term. Basically creating some level of filtering posts.
My first guess is that I have to set some variable to affect the query, any suggestions on how to go about this? Or is there a better way of achieving this?
<h2>Filter By Deployment:</h2>
<?php
$deployments = get_terms( 'deployments', array('orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 1) );
echo '<ul>';
foreach ( $deployments as $deployment ) {
echo '<li><a href="'.get_term_link($deployment->slug, 'deployments').'">'.$deployment->name.'</a></li>';
}
echo '</ul>';
?>
<h2>Filter By Category:</h2>
<?php
$categories = get_terms( 'category', array('orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 1) );
echo '<ul>';
foreach ( $categories as $category ) {
echo '<li><a href="'.get_term_link($category->slug, 'category').'">'.$category->name.'</a></li>';
}
echo '</ul>';
?>
<h2>Filter By Keyword:</h2>
<?php
$tags = get_terms( 'post_tag', array('orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 1) );
echo '<ul>';
foreach ( $tags as $tag ) {
echo '<li><a href="'.get_term_link($tag->slug, 'post_tag').'">'.$tag->name.'</a></li>';
}
echo '</ul>';
?>
tagarchive. You can't be on 2tagarchives at once. So the filtering will have have to go to a custom page, possibly with$_GETparams – janw Dec 18 '12 at 15:07