Situation:
News page – Currently shows the latest 5 news items Archive page – Starts on post 6, I’ve setup pagination.
For testing purposes I’ve got 20 posts numbered 1 – 20.
<?php
$args = array(
'category' => 7,
'posts_per_page' => 5,
'offset' => ( $paged - 1 ) * $posts_per_page + 5,
'paged' => $paged );
?>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts($args);
?>
The above code works fine for archive page 1 but when I click page 2 in the pagination it skips 5 and jumps to post 16.
How would I resolve the above query to prevent skipping 5 posts?
Cheers, Dan
So the final code should look like: