Only show published posts in recent
authorLaury GvR <laury@gaslightmedia.com>
Thu, 4 Feb 2016 15:07:41 +0000 (10:07 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 4 Feb 2016 15:07:41 +0000 (10:07 -0500)
functions.php

index 55b6637..722ef6d 100644 (file)
@@ -144,3 +144,12 @@ add_image_size('glm_blocks', '257', '257', true);
 // needed to keep Woocommerce from constantly complaining.
 add_theme_support( 'woocommerce' );
 ?>
+
+<?php
+    $number_recents_posts = 3;
+   $args=array('numberposts' => $number_recents_posts,'post_status'=>'publish');
+
+    $recent_posts = wp_get_recent_posts( $args );
+    foreach($recent_posts as $post){
+      echo '<li><a href="' . get_permalink($post["ID"]) . '" title="Look '.$post["post_title"].'" >' .   $post["post_title"].'</a> <hr class="skinnydivider" /></li> ';
+    } ?>
\ No newline at end of file