Alter the main query for the front/home page with is_front_page()
and/or is_home()
, like shown below:
add_action('pre_get_posts','wpse104878_alter_main_query');
function wpse104878_alter_main_query($query){
if ( is_admin() || ! $query->is_main_query() ) {
return;
}
if( $query->is_main_query() && is_front_page() || is_home() ){
$query->query_vars['posts_per_page'] = '1';
}
}
The archive page should work, if underscore starter theme has an template for it. You can alter that separatly – similar to above function – with is_archive()
.