Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'pre_get_posts', 'raits_change_posts_per_page' );
- function raits_change_posts_per_page( $query ) {
- // Change is_home() to whatever you want
- // Just make it select just the stuff you want to affect
- if ( $query->is_main_query() && $query->is_home() )
- $query->set( 'posts_per_page', 1 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement