Skip to content

Instantly share code, notes, and snippets.

@nutsandbolts
Last active September 10, 2015 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nutsandbolts/77845882dfadaf72f7eb to your computer and use it in GitHub Desktop.
Save nutsandbolts/77845882dfadaf72f7eb to your computer and use it in GitHub Desktop.
Daily Bolt: increase posts per page
//* Show 12 posts per page
add_action( 'pre_get_posts', 'nabm_change_posts_per_page' );
function nabm_change_posts_per_page( $query ) {
if ( ! $query->is_main_query() || is_admin() || is_feed() ) {
return $query;
}
if ( is_front_page() ) {
$query->set( 'posts_per_page', 12 );
}
return $query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment