I'm trying to configure a filter navigation where the filters fetched are chosen by the taxonomy 'underkategorier' (Sub categories in Swedish).
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.
My query is as follows,
<?php $queryname = array(
'post_type' => 'projekt',
'cat' => 9,
'order' => 'ASC',
'posts_per_page' => '-1',); query_posts( $queryname ); ?>
And my taxonomy list of links is as follows,
<?php $terms = get_terms('underkategorier'); $count = count($terms); if ( $count > 0 ){
echo "<div class='post-tags'><a data-filter='all' class='tax-filter filter'>Visa alla</a>";
foreach ( $terms as $term ) {
echo "<a data-filter='.$term->slug' class='tax-filter filter'>" . $term->name . ' (' . $term->count . ")</a>";
}
echo "</div>";} ?>
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.
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.