Fix page counting

git-svn-id: http://svn.automattic.com/wordpress/trunk@9558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-11-06 22:52:05 +00:00
parent 88d2ecbb4e
commit d58cb434ad
1 changed files with 4 additions and 4 deletions

View File

@ -176,7 +176,7 @@ if ( empty($pagenum) )
if( ! isset( $per_page ) || $per_page < 0 )
$per_page = 20;
$num_pages = ceil(count($posts) / $per_page);
$num_pages = ceil($wp_query->post_count / $per_page);
$page_links = paginate_links( array(
'base' => add_query_arg( 'pagenum', '%#%' ),
'format' => '',
@ -188,9 +188,9 @@ $page_links = paginate_links( array(
if ( $page_links ) : ?>
<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s-%s of %s' ) . '</span>' . __( '%s' ),
number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ),
number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ),
number_format_i18n( $wp_query->found_posts ),
number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
number_format_i18n( min( $pagenum * $per_page, $wp_query->post_count ) ),
number_format_i18n( $wp_query->post_count ),
$page_links
); echo $page_links_text; ?></div>
<?php endif; ?>