pagenavi with merged wp_query [duplicate]

The WP_Pagenavi FAQ links to the following article to explain how to use the Pagenavi plugin with a secondary query by passing the wp_pagenavi() function a query parameter.

From the tutorial:

$my_query = new WP_Query();

while ( $my_query->have_posts() ) : $my_query->the_post();
    the_title();
    // more stuff here
endwhile;

wp_pagenavi( array( 'query' => $my_query ) );

wp_reset_postdata();    // avoid errors further down the page

Leave a Comment