Method 1: You can use pre_get_posts in your functions file to alter the query. This would go in your theme\'s functions.php file.
function limit_archive_posts( $query ) {
if ( $query->is_archive() && $query->is_main_query() && !is_admin() ) {
$query->set( \'posts_per_page\', 5);
}
}
add_action( \'pre_get_posts\', \'limit_archive_posts\' );
Method 2: This can also be achieved by placing the following code before the loop in the archive page.
global $query_string;
query_posts("{$query_string}&posts_per_page=5");
If you have used with custom post type like \'news\' then you can use below code for that.You can use pre_get_posts in your functions file to alter the query. This would go in your theme\'s functions.php file.
function limit_news_archive_post_type( $query ){
if($query->is_post_type_archive(\'news\') && $query->is_main_query() && !is_admin()){
$query->set( \'posts_per_page\', 5 );
}
}
add_action( \'pre_get_posts\', \'limit_news_archive_post_type\' );