WordPress query_posts show the same page
07
Dec
2010
WordPress query_posts show the same page
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 Response to “WordPress query_posts show the same page”
Leave a Reply
Big thanks for this short, concise, post. You wouldn’t believe how some bloggers drivel on about this topic.
Regards,















Big thanks for this short, concise, post. You wouldn’t believe how some bloggers drivel on about this topic.
Regards,