Page navigation within a category

For this particular problem you need to change this..

<?php if (  $wp_query->max_num_pages > 1 ) : ?>

For..

<?php if (  $my_query->max_num_pages > 1 ) : ?>

However, like Rarst said, if you’re looking to change the “main” query, then query_posts is really what you’re looking for, and the change above wouldn’t be required under those conditions(simply update your query to call query_posts and not WP_Query). It’s hard to tell what you’re doing just from what’s posted though, so if you’re unsure, just make the above change.

Leave a Comment