Support » Fixing WordPress » List pages of a taxonomy term?

  • 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’.

        $query = new WP_Query( array( 'artist' => 'hardcodedterm', 'post_type' => 'page' ) );?>
            <?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;?>

  • The topic ‘List pages of a taxonomy term?’ is closed to new replies.