Show 6 posts on the front page

mgibbs189

{{gist file=”test.php” lang=”php”}}
<?php

// Add to your theme’s functions.php
function homepage_post_limit( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( ‘posts_per_page’, 6 );
}
}
add_action( ‘pre_get_posts’, ‘homepage_post_limit’ );
{{/gist}}