Skip to content

Instantly share code, notes, and snippets.

@nutsandbolts

nutsandbolts/functions.php

Last active Sep 10, 2015
Embed
What would you like to do?
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