I am trying to add next and previous page buttons to my template, but when I try to use either next_post_link or previous_post_link, it just does not work.
Could it be because I am using WP_Query?
Here is my code thus far,
<?php get_header(); ?>
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
<?php $args = array(
"post_type" => "page",
"page_id" => $post->ID,
); ?>
<?php $query = new WP_Query($args); ?>
<?php if ($query->have_posts()) : ?>
<?php while ($query->have_posts()) : $query->the_post(); ?>
<!-- do stuff -->
<?php endwhile; ?>
<div id="footer_nav_container">
<div class="left"><?php previous_post_link(); ?></div>
<div class="right"><?php next_post_link(); ?></div>
</div>
<?php else: ?>
<!-- do other stuff here -->
<?php endif; ?>
<?php get_footer(); ?>
Am I maybe missing essential parameters? From what I can see in the codex, it should work fine as I am using it now?
