Last active
December 14, 2015 12:09
-
-
Save kraftbj/5084781 to your computer and use it in GitHub Desktop.
Change number of items returned on home page only (Genesis)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'pre_get_posts', 'change_number_of_posts_home' ); | |
function change_number_of_posts_home( $query ) { | |
global $wp_the_query; | |
if( $query->is_main_query() && is_home() ) { | |
$query->set( 'posts_per_page', '15' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment