You should use the pre_get_posts
filter. You can exclude the homepage with ! is_front_page
or ! is_home
depending on your configuration.
/**
* Changes the number of posts per page if not is_home
*
* @author SFNdesign, Curtis McHale
*/
function wptt_change_posts_on_page( $query ) {
if ( ! is_home() && $query->is_main_query() ) {
$query->set( 'posts_per_page', '10' );
}
}
add_action( 'pre_get_posts', 'wptt_change_posts_on_page' );
As I said, you may need to use ! is_front_page
depending on how your theme is set up. Here is a good blog post explaining more on those conditionals.
http://wpthemetutorial.com/2011/12/12/clearing-up-confusion-about-is_home-and-is_front_page/
Oh and never use query_posts
, evar.
https://developer.wordpress.com/2012/05/14/querying-posts-without-query_posts/