removing duplicate posts from the separate loops
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 3 Feb 2016 16:38:26 +0000 (11:38 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 3 Feb 2016 16:38:26 +0000 (11:38 -0500)
index.php

index 51f18c4..5e4f342 100644 (file)
--- a/index.php
+++ b/index.php
@@ -8,6 +8,7 @@
           $the_query = new WP_Query($args); ?>
           <!-- GUEST BLOGGER SECTION -->
            <?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
+        <?php $do_not_duplicate = $post->ID; ?>
          <div class="row content blog-posts-container">
                <?php $thumbnail = get_the_post_thumbnail($post->ID, 'blog-feed-front'); ?>
                 <?php if ($thumbnail) { ?>
@@ -37,6 +38,7 @@
           
             <!-- MAIN BLOG SECTION -->
             <?php if(have_posts()) : while(have_posts()): the_post();?>
+            <?php if($post->ID == $do_not_duplicate) continue; ?>
             <div class="row content blog-posts-container">
               <!--  <div class="small-11 small-centered columns"> -->
                 <?php $thumbnail = get_the_post_thumbnail($post->ID, 'blog-feed-front'); ?>