Last active
April 14, 2017 05:18
-
-
Save ville6000/ba8109db5e7d4cf5f366 to your computer and use it in GitHub Desktop.
Change post 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 change_posts_per_page( $query ) { | |
if ( is_main_query() && is_archive() ) { | |
$query->set( 'posts_per_page', -1 ); | |
} | |
} | |
add_action( 'pre_get_posts', 'change_posts_per_page' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment