Creating an Archive using a Custom Taxonomy

I recently adjusted the twentyten theme to display archives in a three column grid. In doing so, it seems that the archive has lost the ability to display posts from the specified taxonomy.

For instance, a taxonomy type is ‘Flowers’, with a specific flower being ‘Rose’. When the ‘Rose’ archive is displayed, it simply lists all posts. I believe I have narrowed the problem to this line:


I understand that it is just listing all ‘uncategorized’ posts, but I am at a loss with how to have display a specific taxonomy archive as would normally be done for a category archive.

Any ideas? I am guessing it isn’t as hard as I am making it, but I have searched for hours with no luck.

Thanks in advance!

Solutions Collecting From Web of "Creating an Archive using a Custom Taxonomy"

you can add the current term to you query so if its category, tag or custom taxonomy you will get the posts with the current term, try changing this:


with this:

$term_slug = get_query_var( 'term' );
$taxonomyName = get_query_var( 'taxonomy' );
query_posts(array('posts_per_page' => 12, 'paged' => $paged, $taxonomyName => $term_slug));

+1 to Milo answer. But if you need to change the post_per_page parameter, try this:

global $query_string;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;