Loop to show posts with current term of taxonomy
I’ve created a custom post type and a custom taxonomy to go with it.
I can’t figure out how to program the loop on the taxonomy.php template to make it only show the posts that correspond with the current term of its taxonomy. <domain>taxonomy/term
<?php $args = array( 'post_type' => 'domande-offerte', 'tag' => get_query_var('citta'), 'posts_per_page' => 15 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post();?> <?php wp_pagenavi(); ?>
What am I doing wrong?
- The topic ‘Loop to show posts with current term of taxonomy’ is closed to new replies.