rveitch
2/8/2016 - 5:22 PM

WP Loop - Do Not Duplicate Posts

WP Loop - Do Not Duplicate Posts

<?php 
global $do_not_duplicate;
global $post;

$the_query = new WP_Query(array( 'tag' => get_option('mvp_feat_posts_tags'), 'posts_per_page' => '1'  ));

while($the_query->have_posts()) : $the_query->the_post();
$do_not_duplicate[] = $post->ID;
if (isset($do_not_duplicate)) { ?>

<?php # Post loop goes here ?>

<?php } #endif
endwhile;
# Pagination goes here
wp_reset_postdata(); ?>

<? # Pagination example: ?>
  <div class="nav-previous alignleft">
    <a href="<?php next_posts_link( 'Older posts' ); ?>"> Older Posts </a>
    </div>
  <div class="nav-next alignright">
    <a href="<?php previous_posts_link( 'Newer posts' ); ?>"> More Posts </a>
  </div>