How to modify query so it grabs only 90 posts in total?

Try using paginate_links( $args ). Here is code adopted from codex.

$paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;

$args = array(
    'posts_per_page' => 30,
    'paged' => $paged,
);

$the_query = new WP_Query( $args );

// the loop etc goes here.. 

$big = 999999999; 

echo paginate_links( array(
    'base'       => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
    'format'     => '?paged=%#%',
    'current'    => max( 1, get_query_var('paged') ),
    'prev_next'  => false,
    'total'      => 3
) );

See detail here on codex.

Leave a Comment