query_posts pagination not working
-
I am not getting pagination to work with the following code, can anyone advise?
<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'cat' => '5', 'post_type' => 'post', 'posts_per_page' => 6, 'paged' => $page, ); query_posts($args); while (have_posts()) { the_post(); ?> <div class="project_item"> <div class="dotted"> <hr /> </div> <div class="project_thumb"><a href="<?php echo get_permalink(); ?>"><img src="<?php getCustomField('news_thumbnail'); ?>" /></a></div> <div class="project_entry"><h4><a href="<?php echo get_permalink(); ?>"><?php getCustomField('news_title'); ?></a></h4> <?php getCustomField('news_excerpt'); ?> <a href="<?php echo get_permalink(); ?>" class="readmore">Read more..</a> </div> </div> <?php } wp_reset_query(); // Restore global post data ?>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘query_posts pagination not working’ is closed to new replies.