Created
May 10, 2013 20:49
-
-
Save JiveDig/5557296 to your computer and use it in GitHub Desktop.
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
// ----------------------- Set the number of a custom post type posts per page | |
add_filter( 'pre_get_posts', 'be_archive_query' ); | |
// @link http://www.billerickson.net/customize-the-wordpress-query/ | |
function be_archive_query( $query ) { | |
if( $query->is_main_query() && $query->is_post_type_archive('code') ) { | |
$query->set( 'posts_per_page', 24 ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment