title: Query taxonomies depending on specific category - Wordpress
body: <p>I'm trying to configure a filter navigation where the filters fetched are chosen by the taxonomy 'underkategorier' (Sub categories in Swedish).</p>
  
  <p>The problem I'm having is that I have two pages of which both query different kinds of categories. But for some reason I can't get my list of custom taxonomy links to just list objects within that specific category. One page lists custom posts from Category nr 9 and the other lists custom posts from category 10.</p>
  
  <p>My query is as follows,</p>
  
  <pre><code>&lt;?php $queryname = array(
  'post_type'      =&gt; 'projekt',
  'cat'     =&gt; 9,
  'order'    =&gt; 'ASC',
  'posts_per_page' =&gt; '-1',); query_posts( $queryname ); ?&gt;
  </code></pre>
  
  <p>And my taxonomy list of links is as follows,</p>
  
  <pre><code>     &lt;?php $terms = get_terms('underkategorier'); $count = count($terms);  if ( $count &gt; 0 ){
   echo "&lt;div class='post-tags'&gt;&lt;a data-filter='all' class='tax-filter filter'&gt;Visa alla&lt;/a&gt;";
   foreach ( $terms as $term ) {
     echo "&lt;a data-filter='.$term-&gt;slug' class='tax-filter filter'&gt;" . $term-&gt;name . '&amp;nbsp;(' . $term-&gt;count . ")&lt;/a&gt;";      
   }
   echo "&lt;/div&gt;";} ?&gt;
  </code></pre>
  
  <p>So. I want to display links of category 9 + taxonomy 'underkategorier'. Not posts, but terms. For example if 'underkategorier' has a few terms like, 'buildings', 'parks', railways' I want do display these as links. But only if they belong to category 9 as well. So if there where a fourth 'underkategori' by name 'stadiums' which belonged to a category 10 post, this would not show up on the page that displays category 9 posts.</p>
  
  <p>I am still quite new to these coding parts and I could really use some help and would be very grateful. If my question is fuzzy please let me know and I'll try to rephrase. When I get it right I will share it with you all for future help.</p>