Shows a safe pre_get_posts pattern for modifying only the primary front-end query.
add_action( 'pre_get_posts', 'wpfolks_adjust_main_blog_query' );
function wpfolks_adjust_main_blog_query( $query ) {
if ( is_admin() || ! $query->is_main_query() || ! $query->is_home() ) {
return;
}
$query->set( 'posts_per_page', 12 );
}