removing private and drafts from the landing page template. no private or draft pages...
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 8 Sep 2016 15:12:07 +0000 (11:12 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 8 Sep 2016 15:12:07 +0000 (11:12 -0400)
landing-page.php

index 5c35396..bc5e7c6 100644 (file)
@@ -30,40 +30,41 @@ Template Name: Landing Page
         <div class="row">
             <div id="main-content" class="small-12 columns">
                 <div id="crumb-line">
-                            <div class="row">
-                            <?php
-                                get_template_part('parts/bread-crumbs');
-                            ?>
-                            </div>
-                        </div>
-                        <?php $page_object = get_page( $post->ID ); ?>
-                        <?php echo '<div class="custom-content">' . apply_filters('the_content', $page_object->post_content) . '</div>'; ?>
+                    <div class="row">
+                    <?php
+                        get_template_part('parts/bread-crumbs');
+                    ?>
+                    </div>
+                </div>
+                <?php $page_object = get_page( $post->ID ); ?>
+                <?php echo '<div class="custom-content">' . apply_filters('the_content', $page_object->post_content) . '</div>'; ?>
                  <div class="row">
                    <?php if ( $parent->have_posts() ) : ?>
                      <?php while ( $parent->have_posts() ) : $parent->the_post(); ?>
+                      <?php $status = get_post_status(); ?>
+                      <?php if ($status !== 'private' && $status !== 'draft'){ ?>
                        <?php $id = get_the_ID();
-                        if(get_post_thumbnail_id($id)){
-                            $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'glm_block');
-                        } else {
-                            $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post_parent), 'glm_block');
-                        }
-                     ?>
-
-                    <div id="<?php the_ID(); ?>" class="small-12 medium-4 large-3 columns child-page">
-<!--                        <div id="image-<?php the_ID();?>" class="child-image-container" style="background: url()">-->
-                           <a href="<?php echo get_permalink($id); ?>">
-                            <img class="child-image" src="<?php echo $image_data[0]; ?>" />
-                           </a>
-<!--                        </div>-->
-                        <h6 class="child-page-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h6>
-
-                    </div>
+                            if(get_post_thumbnail_id($id)){
+                                $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'glm_block');
+                            } else {
+                                $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post_parent), 'glm_block');
+                            }
+                       ?>
 
+                        <div id="<?php the_ID(); ?>" class="small-12 medium-4 large-3 columns child-page">
+    <!--                        <div id="image-<?php the_ID();?>" class="child-image-container" style="background: url()">-->
+                               <a href="<?php echo get_permalink($id); ?>">
+                                <img class="child-image" src="<?php echo $image_data[0]; ?>" />
+                               </a>
+    <!--                        </div>-->
+                            <h6 class="child-page-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h6>
+                        </div>
+                    <?php } ?>
                     <?php endwhile; ?>
 
                     <?php endif; wp_reset_query(); ?>
+                </div>
             </div>
-        </div>
 
 
     </div>