So I have a WP_Query like so:
$homepage = new WP_Query( 'posts_per_page=1&cat=-5' );
and in my while loop, I have a call to
previous_post_link(), which are both showing posts from the excluded category. Here is what my code looks like next:
<?php while ( $homepage->have_posts() ) : $homepage->the_post(); ?> <?php next_post_link('« %link'); ?> <?php previous_post_link('%link »'); ?> <?php endwhile; ?>
According to the wordpress docs on next_posts_link & previous_posts_link, these functions are based on the current query:
Prints a link to the next set of posts within the current query.
So does anybody have an idea of why
previous_post_link() would show posts that should be excluded while the rest of the loop works as expected?