Archived and Categories not being paginated correctly
-
Here’s my site: https://tambnguyen.com/, and I’m using WP 3.1 with WP-PageNavi 2.74.
My problem is when view the site under either Categories or Archives, the pagination is not working correctly. For example, in Feb 2011, I posted 12 entries. When viewing https://tambnguyen.com/2011/02/, it only shows the first page. When clicking on the second page (https://tambnguyen.com/2011/02/page/2/), I get a soft 404. The same thing happens when viewing the categories.
I’ve tried disabling all the plugins to the bare minimum, and yet still have that problem. Currently, I have DB Cache Reloaded, W3 Total Cache (Minify, Object cache, Browser cache and CDN enabled).
Here’s my index.php:
<?php if (is_archive()) $post_number = get_option('polished_archivenum_posts'); if (is_search()) $post_number = get_option('polished_searchnum_posts'); if (is_tag()) $post_number = get_option('polished_tagnum_posts'); ?> <?php get_header(); ?> <?php global $query_string; query_posts($query_string . "&showposts=$post_number&paged=$paged"); ?> <div id="wrap"> <!-- Main Content--> <img src="<?php bloginfo('template_directory');?>/images/content-top.gif" alt="content top" class="content-wrap" /> <div id="content"> <!-- Start Main Window --> <div id="main"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php include(TEMPLATEPATH . '/includes/entry.php'); ?> <?php endwhile; ?> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?> <?php include(TEMPLATEPATH . '/includes/navigation.php'); ?> <?php } ?> <?php else : ?> <?php include(TEMPLATEPATH . '/includes/no-results.php'); ?> <?php endif; wp_reset_query(); ?> </div> <!-- End Main --> <?php get_sidebar(); ?> <?php get_footer(); ?>
and here’s my category.php
<?php get_header(); ?> <div id="wrap"> <!-- Main Content--> <img src="<?php bloginfo('template_directory');?>/images/content-top.gif" alt="content top" class="content-wrap" /> <div id="content"> <!-- Start Main Window --> <div id="main"> <?php global $query_string; $catnum_posts = get_option('polished_catnum_posts') ; query_posts($query_string . "&showposts=$catnum_posts&paged=$paged&cat=$cat"); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php include(TEMPLATEPATH . '/includes/entry.php'); ?> <?php endwhile; ?> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?> <?php include(TEMPLATEPATH . '/includes/navigation.php'); ?> <?php } ?> <?php else : ?> <?php include(TEMPLATEPATH . '/includes/no-results.php'); ?> <?php endif; wp_reset_query(); ?> </div> <!-- End Main --> <?php get_sidebar(); ?> <?php get_footer(); ?>
Please take a look and thanks for your help guys.
- The topic ‘Archived and Categories not being paginated correctly’ is closed to new replies.