Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using the following code to create a list of linked terms belonging to a taxonomy.

<?php
$taxonomy = 'taxonomy_name';
$queried_term = get_query_var($taxonomy);
$terms = get_terms($taxonomy, 'slug='.$queried_term);
if ($terms) {
  echo '<ul>';
  foreach($terms as $term) {
    echo '<li><a href="'.get_term_link($term->slug, $taxonomy).'">'.$term->name.'</a></li>';
  }
  echo '</ul>';
}
?>

Is there a way that I can modify this so that once a term is selected/clicked and the archive is shown, the term list will then only show terms that are also attached to posts in the current term archive - effectively like a filtering/drill-down system?

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.