-
-
Save davidperezgar/6ab831b4d052d2ce458f292564e09bed to your computer and use it in GitHub Desktop.
Archive Query
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_filter( 'pre_get_posts', 'be_archive_query' ); | |
/** | |
* Archive Query | |
* | |
* Sets all archives to 27 per page | |
* @since 1.0.0 | |
* @link http://www.billerickson.net/customize-the-wordpress-query/ | |
* | |
* @param object $query | |
*/ | |
function be_archive_query( $query ) { | |
if( $query->is_main_query() && $query->is_archive() ) { | |
$query->set( 'posts_per_page', 27 ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment