Reputation: 11
On Wordpress, how can I show the latest post (one only) on the homepage with full text, comments and all?
I basically would like the homepage to be the latest post as if I clicked it and got the post url (like: domain/wordpress/?p=18
for example).
Upvotes: 0
Views: 6572
Reputation: 11
Thanks guys for the reply. I did what you've suggested TheLibzter :-) windyjonas, your answer was partial right. What eventually did the trick is:
<?php query_posts(); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
<?php the_title(); ?>
</a>
</h2>
<div class="entry"><?php the_content(); ?></div>
</div>
<?php endwhile; ?>
<?php
global $withcomments; $withcomments = true;
comments_template( '', true );
?>
Upvotes: 1
Reputation: 777
Here's what I would do:
That should do the trick, but let me know if it doesn't work for you. :)
Upvotes: 1
Reputation: 2322
Redirect from home.php:
if (have_posts()):
while (have_posts()):
the_post();
wp_redirect(get_permalink());
endwhile;
endif;
Upvotes: 0