Created
February 13, 2015 23:07
-
-
Save ellenbo/eb646b23fe7a83e3cf8b to your computer and use it in GitHub Desktop.
Set Number of Posts per Page
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
<?php | |
function five_posts_on_homepage( $query ) { | |
$query->set( 'posts_per_page', 5 ); | |
} | |
add_action( 'pre_get_posts', 'five_posts_on_homepage' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment