Hi- I’m having a slightly similar issue. I have a newsletter that lists future events. I want the newsletter to only show the next 7 posts in the future. When it does the count, it also includes previous posts in the count but doesn’t dispay them.
So, if I set numberposts=7, and there’s 4 posts that appear in the past, it shows the next 3 posts. Does that makse sense? What I want is for it to show the next 7 posts in the future, regardless of how many posts appear in the past. Any help would be greatly appreciated.
Here’s the code:
<?php
$lastposts = get_posts('numberposts=7&category=4&order=ASC&post_status=future,publish');
foreach($lastposts as $post) :
setup_postdata($post);
if(is_category('newsletter')) {
if(strtotime($post->post_date) < time())
continue;
}
?>
<!-- stuff goes here -->
<?php endforeach; ?>