I am having problems with pagination
on category
page that lists posts only within a certain category. Here is my code:
What happens is the Next
link takes to /page/2
but the content stays the same.
<?php
$id = get_cat_id($current_category);
$my_query = new WP_Query('cat='. $id .'&showposts=2');
while ($my_query->have_posts()) : $my_query->the_post();
?>
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'themename' ) ); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php if ( $my_query->max_num_pages > 1 ) : ?>
<nav id="nav-below">
<div class="next"><?php previous_posts_link( __( '<span></span> Previous ', 'themename' ) ); ?></div>
<div class="prev"><?php next_posts_link( __( 'Next <span></span>', 'themename' ) ); ?></div>
</nav>
<?php endif; ?>