get_posts problem
-
I am using get_posts in my footer to get the last five posts. The problem is it is only showing my dates for the first one. Here is the code..
<?php
if(is_home()) {
$archive_posts = get_posts('numberposts=5&offset=1');
} else {
$archive_posts = get_posts('numberposts=5');
}
foreach($archive_posts as $post) :
//setup_postdata($post);
?>
<dt><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></dt>
<dd><? the_date(); ?></dd>
<?php endforeach; ?>Here is the page..
https://redplaidshirt.com/?p=13
You will notice that the setup_postdata is commented out. The reason for this is, when I use that, it resets the post number to the last post displayed in the list and directs my comments to post to that last post in the list instead of the current post displayed.
The footer list works on the homepage because I am using the setup_postdata, since there is no comments to mess up.
Can anyone tell me why only the first date is displayed?
Thanks!
Brian
- The topic ‘get_posts problem’ is closed to new replies.