I created a new template in WordPress to show the latest articles. After, I will sort them in other ways. My problem is I can not use the pagination correctly.
The next page and previous page are working ok, but the posts are not changed. The first three are the only that are shown.
Can you give me a clue about this ?
<?php
/*
Template Name: Latest Prizes
*/
get_header();
// The Query
query_posts( 'posts_per_page=3' );
// The Loop
while ( have_posts() ) : the_post();
echo '<li>';
the_title();
echo '</li>';
endwhile;
posts_nav_link(' · ', 'previous page', 'next page');
// Reset Query
wp_reset_query();
get_footer(); ?>
From the WordPress Codex on
query_posts()
:Change your
query_posts()
to this: