wordpress pagination links problems
I'm trying to i开发者_如何学Gomplement pagination in a custom WP-Query. The pagination is done correctly, but the links are wrong. If I have, for example, 10 posts and 8 posts per page, I have a page 1 with 8 posts (OK for now), a page 2 with 2 posts (still OK), but I can access a page 3 with 0 posts, and so on...
I'm trying also to implement wp_navi an I'm having an infinite navigation menu for only 10 posts.
The code used is the following:
<?php next_posts_link('« Previous') ?>
<?php previous_posts_link('Next') ?>
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$featuredPosts = new WP_Query("category_name=Destacadas&paged=".get_query_var('paged'));
while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?>
<div class="post_container">
<?php include ('post-info-reduced.php'); ?>
</div>
<?php endwhile; ?>
Have you had this problem?
I've found the solution for using it with WP-PageNavi:
http://scribu.net/wordpress/wp-pagenavi/wpn-2-74.html
精彩评论