Created
October 14, 2014 13:20
-
-
Save arioch1984/8f60e887af5b0110341f to your computer and use it in GitHub Desktop.
Filter posts per page
This file contains hidden or 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 my_custom_posts_per_page($query){ | |
$query->query_vars['posts_per_page'] = 3; | |
} | |
add_filter( 'pre_get_posts', 'my_custom_posts_per_page' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment