function trance_posts_per_page( $query ) {
$query->set( 'posts_per_page', 20 );
}
add_action( 'pre_get_posts', 'trance_posts_per_page' );
// This will always set the Posts Per Page option to 1 to fix the WordPress bug
// when the pagination would return 404 page. To set the number of posts shown
// on the blog page please use the field under Theme Settings > Content > Blog > Post Count
function gantry_posts_per_page() {
if( get_option( 'posts_per_page' ) != '1' ) update_option( 'posts_per_page', '1' );
}
Time to create page: 0.059 seconds