add_action( 'pre_get_posts', 'cr_custom_post_per_page' );
function cr_custom_post_per_page( $query )
{
if ($query->is_main_query() && !$query->is_feed() && !is_admin()) {
$first_page_post_count = 8;
$empty_pages_post_count = 16;
$paged = $query->query_vars['paged'];
if ($paged > 1) {
$posts_per_page = $empty_pages_post_count;
if ($paged == 2) {
$offset = $first_page_post_count;
} else {
$offset = $first_page_post_count + ( $empty_pages_post_count * ($paged - 2));
}
} else {
$offset = 0;
$posts_per_page = $first_page_post_count;
}
$query->set('posts_per_page', $posts_per_page);
$query->set('offset', $offset);
}
}