Created
November 18, 2020 02:32
-
-
Save braddalton/78940a5bf547f5f19022ea6f8ea97af3 to your computer and use it in GitHub Desktop.
Set Posts Per Page On Home 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
add_action( 'pre_get_posts', 'posts_per_page_home' ); | |
function posts_per_page_home($query) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$query->set( 'posts_per_page', '1' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment