Category pagination
-
I’m having a bit of trouble with my category pagination.
My
category.phpfile is set up to show only 5 posts and then start paginating, which I’m doing with the wp-pagenavi plugin.I have 6 posts in my Photography category. The pagination links show up at the bottom, but page two is empty and returns “No posts to show for this category.”
Source of
category.phpis below:<?php get_header();?> <div id="page-title"> <h1><?php single_cat_title(); ?></h1> <form> <label>All Categories</label> <select name="month" onChange="MM_jumpMenu('parent',this,1)"> <option selected="selected">Select</option> <option value="<?php bloginfo('url');?>/mixed-media">Mixed Media</option> <option value="<?php bloginfo('url');?>/graphic-design">Graphic Design</option> <option value="<?php bloginfo('url');?>/photography">Photography</option> </select> </form> </div> <div class="grid_16 alpha gallery"> <ul class="entries"> <?php if ( have_posts() ) : query_posts(array('paged'=> get_query_var('paged') ? get_query_var('paged') : 1, 'showposts'=>'5',)); while ( have_posts() ) : the_post(); ?> <li> <a href="<?php the_permalink();?>"> <img src="<?php $customField = get_post_custom_values("Thumbnail"); if (isset($customField[0])) {echo $customField[0];}?>" width="168" height="168" /> </a> </li> <?php endwhile; ?> </ul> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> <?php else : ?> No posts to show for this tag. <?php endif; ?> </div> <?php get_footer();?>
The topic ‘Category pagination’ is closed to new replies.