• I discovered a line of code that paginates taxonomy pages

    <?php
    $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;

    query_posts($query_string .’&posts_per_page=5&order=asc&orderby=title&posts_per_page=2&paged=’ . $paged); ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <?php endwhile; ?>

    <?php endif; ?>

    But I need to create a unique page and url that queries one taxonomy term, which I would normally do like this

    <?php $loop = new WP_Query( array( ‘post_type’ => ‘the post type’s name’, ‘the taxonomy name’ => ‘the taxonomy term’, ‘orderby’ => ‘title’, ‘order’ => ‘asc’, ‘posts_per_page’ => 10 ) ); ?>

    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

    <?php endwhile; ?>

    Does anybody know how to re-write/combine these two, to query one taxonomy term but also paginate the list?

  • The topic ‘Writing Taxonomy in a $query_string’ is closed to new replies.