Vote count:
0
I have a walker to display terms of a taxonomy (see post here). It's a hierarchical list that is 3 levels deep:
Taxonomy
- terms
- subterms
- subsubterms
- display post with Category "Subsubterms"
- subsubterms
- subterms
The terms display fine, but the posts on subsubterm-level do not display. The following code only displays post from the "Uncategorized" category.
$post_query = new WP_Query($taxonomy, array(
'term' => $subsubterm->term_id
)); ?>
<?php if ( $post_query->have_posts() ) :
$return .= '<ul>';
while ( $post_query->have_posts() ) : $post_query->the_post();
$return .= '<li><a class="link" href="' . get_permalink() . '">' . get_the_title() . '</a></li>' . "\n";
endwhile;
$return .= '</ul>';
wp_reset_postdata();
else:
endif;
I'm not sure if this part is even possible:
'term' => $subsubterm->term_id
Thanks!
asked 35 secs ago
Wordpress: Dynamically query/filter posts by taxonomy term_id
Aucun commentaire:
Enregistrer un commentaire