How to define a taxonomy term to list of pages within a term
I’ve been working on trying to create a listing of pages within a taxonomy term and for the most part I’ve been able to get it working when I hard code the term in my wp query. Ideally what I’d like it to do is change to display the appropriate list when on a page with a different taxonomy term.
How can I make it so that it will pick the current taxonomy term and stick it within my new wp query?
<?php $query = new WP_Query( array( 'artist' => 'HARDCODEDTERM', 'post_type' => 'page' ) );?> <ul> <?php while ( $query->have_posts() ) : $query->the_post();?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li> <?php endwhile;?> </ul>
- The topic ‘How to define a taxonomy term to list of pages within a term’ is closed to new replies.