Latests posts shows future posts Problem
-
I am sure someone fixed this before, I just need to know what to change this code to in my my-hacks.php file.
function get_recent_posts($no_posts = 5, $before = '- ', $after = '
', $show_pass_post = false, $skip_posts = 0) {
global $wpdb, $tableposts;
$request = "SELECT ID, post_title FROM $tableposts WHERE post_status = 'publish' & ";
if(!$show_pass_post) { $request .= "AND post_password ='' "; }
$request .= "ORDER BY post_date DESC LIMIT $skip_posts, $no_posts";
$posts = $wpdb->get_results($request);
$output = '';
foreach ($posts as $post) {
$post_title = stripslashes($post->post_title);
$permalink = get_permalink($post->ID);
$output .= $before . '' . $post_title . '' . $after;
}
echo $output;
}
The topic ‘Latests posts shows future posts Problem’ is closed to new replies.