Last active
April 26, 2019 12:39
-
-
Save stefanledin/929d610ee17e3eed220d9907753945ba to your computer and use it in GitHub Desktop.
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 | |
add_action( 'pre_get_posts', function( $query ) { | |
if ( ! is_admin() && is_post_type_archive( 'articles' ) ) { | |
$query->set('posts_per_page', 1); | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment