Solar Polar

Dave Walker, Malton, North Yorkshire. Blog, Music, Web and OpenEdge

Blog

WordPress query_posts show the same page1

Posted on December 7th, 2010 in Web Stuff

Sometimes I forget to amend any special queries I’ve setup within WordPress templates so that when I click on the “older posts” button I simply get the same page displayed again.

For special queries you should add the paging code below.

<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('category_name=staff&posts_per_page=10&paged=' . $paged); ?>
One Comment
  1. Big thanks for this short, concise, post. You wouldn’t believe how some bloggers drivel on about this topic.

    Regards,

Leave a Reply