Draft posts showing up in 'recent posts' feed
-
Hi,
I am using this custom code to display my recent posts in order to add the HR afterwards. I thought this preferable to using a background image to show a small dividing line in between posts.However, draft posts that are still being written are displaying in the list of recent posts, and they can be clicked through to and viewed (even when not logged in).
This is obviously a problem, can anybody advise what I have done wrong?
Thanks in advance
<?php $recent_posts = wp_get_recent_posts(); foreach( $recent_posts as $recent ){ echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.$recent["post_title"].'" >' . $recent["post_title"].'</a> <hr class="skinnydivider" /></li> '; } ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Draft posts showing up in 'recent posts' feed’ is closed to new replies.