WordPress.org

Ready to get started?Download WordPress

Forums

List pages of a taxonomy term? (1 post)

  1. NoArtworkAvailable
    Member
    Posted 1 year ago #

    Is there a way to list the pages that are under a current taxonomy term? I have been able to get it to display the pages when the taxonomy term is hardcoded, but I can't figure out how to get the term for the current page and put it in a wp_query. I was hoping to have it not hardcoded so that the list will change if the taxonomy term changes.

    Is there a way I can replace 'hardcodedterm' with '$currentartist' or something similar?

    This is what I am using to display the list for the 'hardcodedterm'.

    <?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>

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by NoArtworkAvailable
  • This topic is not resolved
  • WordPress version: 3.5.1