Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Grouping pages/posts into taxonomies is great IF you can list the pages under each category.

For instance, I have set a taxonomy as 'WordPress Reference'. Then I have a "category" (I think that's what it is) under the taxonomy called "Subject 1".

I have then set two pages to "Subject 1" under WordPress Reference.

Then I created a custom page template with a wp_list_categories command:

<?php wp_list_categories('taxonomy=wordpress-reference'); ?>

Now this accomplishes a list of categories but for each category I want to display the list of pages associated with the category. How can I do this?

share|improve this question

1 Answer 1

To answer my question:

You can use the loop to query only posts based on a taxonomy & terms :

query_posts('taxonomy'='term');

& then run the loop:

if ( have_posts() ) : while ( have_posts() ) : the_post();
echo '<h6>'; ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php
echo '</h6>';
the_date();
the_excerpt();
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.