Created
March 15, 2012 18:20
-
-
Save billerickson/2045807 to your computer and use it in GitHub Desktop.
Archive Query
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 | |
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
The documentation is out of sync with the code (nothing to do with attachments).
Also, the @SInCE should go under the long description (bit about 27 per page).