Add $post_per_archive_page to override the number of posts to show for an archive page. Turn off paging if $post_per_* are set to -1.

git-svn-id: https://develop.svn.wordpress.org/trunk@1835 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2004-10-27 23:58:40 +00:00
parent 5a32ea0adc
commit 00d3226b7b
2 changed files with 11 additions and 13 deletions
+10 -1
View File
@@ -212,7 +212,16 @@ class WP_Query {
$q['showposts'] = (int) $q['showposts'];
$q['posts_per_page'] = $q['showposts'];
}
if ( (isset($q['posts_per_archive_page']) && $q['posts_per_archive_page'] != 0) && (is_archive() || is_search()) )
$q['posts_per_page'] = $q['posts_per_archive_page'];
if ( !isset($q['nopaging']) ) {
if ($q['posts_per_page'] == -1) {
$q['nopaging'] = true;
} else {
$q['nopaging'] = false;
}
}
$add_hours = intval(get_settings('gmt_offset'));
$add_minutes = intval(60 * (get_settings('gmt_offset') - $add_hours));
$wp_posts_post_date_field = "post_date"; // "DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)";