WordPress.org

Support

Support » Themes and Templates » [Resolved] Previous & next post link in custom queries

[Resolved] Previous & next post link in custom queries

  • Hi all,

    Using a custom query, I can’t get the next_post_link() to work.

    Query is built like this:

    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $paged = get_query_var('paged');
    $wp_query->query('showposts=1'.'&paged='.$paged.'&post_type=Nieuws');
    while ($wp_query->have_posts()) : $wp_query->the_post();
    $do_not_duplicate = $post->ID;
    
    <-- does things -->
    
    endwhile;  ?>
    <div class="contentnavigation">
    » <?php previous_post_link(); ?>
    » <?php next_post_link(); ?>
    </div>
    <?php $wp_query = null; $wp_query = $temp;?>

    Any thought would be much appreciated!

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Previous & next post link in custom queries’ is closed to new replies.