adding post_status arg to recent posts
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 21 Mar 2016 13:08:13 +0000 (09:08 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 21 Mar 2016 13:08:13 +0000 (09:08 -0400)
parts/blog-sidebar-r.php

index 66a24be..b0ec792 100644 (file)
@@ -8,7 +8,7 @@
                 <p>Recent Posts</p>
                 <ul>
                 <?php
-                        $args = array( 'numberposts' => '5' );
+                        $args = array( 'numberposts' => '5', 'post_status' => 'publish' );
                         $recent_posts = wp_get_recent_posts( $args );
                         foreach( $recent_posts as $recent ){
                                 echo '<li><a href="' . get_permalink($recent["ID"]) . '">' .   $recent["post_title"].'</a> </li> ';