get_query_var( ‘paged’ ) not working outside of homepage

twentyeleven_content_nav() uses the main query object, $wp_query. You’ll need to use the $wp_query variable, rather than $unfiltered_query, then wp_reset_query() to restore the original $wp_query (which it’ll find in $wp_the_query, something you should probably avoid touching directly).

As long as you’re careful to restore the original query, you’re in good shape.

I would submit a patch to core that allows twentyeleven_content_nav() to optionally take a query object which it can use for its calculations.

Leave a Comment