removing drafts from recent posts display
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 15 Feb 2016 13:35:56 +0000 (08:35 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 15 Feb 2016 13:35:56 +0000 (08:35 -0500)
parts/blog-sidebar-r.php

index 3675212..b6e435a 100644 (file)
@@ -23,7 +23,9 @@
                         $args = array( 'numberposts' => '5' );
                         $recent_posts = wp_get_recent_posts( $args );
                         foreach( $recent_posts as $recent ){
+                            if(get_post_status($recent["ID"]) != "draft"){
                                 echo '<li><a href="' . get_permalink($recent["ID"]) . '">' .   $recent["post_title"].'</a> </li> ';
+                            }
                         }
                 ?>
                 </ul>