Wordpress - get_query_var( 'paged' ) not working outside of homepage
the argument for WP_Query is paged
, but the query var is page
, no 'd' on the end.
'paged' => get_query_var( 'paged' )
should be:
'paged' => get_query_var( 'page' )
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.