browngrapevine
Forum Replies Created
-
Thank you! Adding “global post” function to the code seems to do the trick. I now see the correct post title/link. However, now the “comments” box appears at the bottom of the post excerpt, even though the “Comments” box for the homepage has been disabled. Any suggestions why that is happening?
Here’s my code now:
<?php wp_reset_query(); ?>
<?php
global $post;
$previous_posts = get_posts('numberposts=1');
foreach($previous_posts as $post) :
setup_postdata($post); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php the_excerpt(); ?>
<?php endforeach; ?>thanks for your fast comment. I just tried that, and it didn’t change the title/link that’s displayed.
Sorry – the code didn’t display correctly in my last e-mail:
<?php
$previous_posts = get_posts('numberposts=1');
foreach($previous_posts as $post) :
setup_postdata($post); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php the_excerpt(); ?>
<?php endforeach; ?>