Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
1st Paginated Archive Page 1 post
add_action( 'pre_get_posts', 'posts_per_page_home' );
function posts_per_page_home($query) {
if ( $query->is_home() && $query->is_main_query() && get_query_var( 'paged' ) < 2 ) {
$query->set( 'posts_per_page', '1' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment