[Resolved] Paging displays 1 extra page that is empty
I’ve been searching for hours but could find any soloution to my problem.
I have a template-file that lists all the posts from the category “blogg”
What i want to do is show the first 10 posts, then use
next_posts_linkto go to page 2 etc etc.
And if it’s less then 10 posts, it still displays navigation, and ads 2 extra pages, thats empty.
It works, exept for one thing. When i’ve clicked through the pages, i get one last page thats empty. Any ideas? Heres the code:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $get_blog = new WP_Query('category_name=blogg&posts_per_page=10&paged=' . $paged);?> <?php while ($get_blog->have_posts()) : $get_blog->the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
And the navigation:
<?php previous_posts_link('« Nyare') ?> <?php next_posts_link(' Äldre »') ?>
Thanks in advanced!
- The topic ‘[Resolved] Paging displays 1 extra page that is empty’ is closed to new replies.