views:

38

answers:

1

I did the following to display a single post in my home page:

home.php:

<?php
get_header();
query_posts('posts_per_page=1'); //returns only the front page
?>

<div id="content">
    <?php
    /* Run the loop to output the posts.
     * If you want to overload this in a child theme then include a file
     * called loop-index.php and that will be used instead.
     */
    get_template_part( 'loop', 'index' );
    ?>
</div>
<div id="sidebar">
    <?php get_sidebar(); ?>
</div>
<div id="footer">
<?php get_footer(); ?>

But I still ahave to click Comments in order to see the comments and the form to leave a comment. How can I automatically show immediately?

+1  A: 

Load the comments template using <?php comments_template(); ?> - that'll display all comments for the current post.

TheDeadMedic
@TheDeadMedic Sorry, I placed that code right before the #content div and nothing happened!
janoChen
If you want to show comments before you load the loop, call `the_post()`, load your comments, then reset the loop with `rewind_posts()`.
TheDeadMedic