WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My home.php is associated with my blog page, as opposed to rest of site which is just a cms. I want my blog page to render the comments ability, an archive of older posts, tags, blogroll, etc. Right now, this is what I have in my home.php:

Template Name: Home
<?php get_header(); ?>
    $blog_query = new WP_Query;
    $blog_query->query( 'post_type=post' );
<div id="post-content">

<?php echo "Blog updated daily" ?>

<?php if( $blog_query->have_posts() ) : ?>

    <?php while( $blog_query->have_posts() ) : $blog_query->the_post(); ?>

    <div class="post">
        <h2 id="post-<?php the_ID(); ?>"><?php the_title();?></h2>
        <?php the_content(); ?>

    <?php endwhile; ?>

<?php endif; ?>

<?php wp_reset_query(); ?>

<?php get_footer(); ?>

Problem is obviously, this just rendering the posts, but not the comment section or anything else. How can I inherit the wordpress defaults so that it will display the comment section and so forth? Right now If i was to remove that code above, the page would be blank.

share|improve this question
This question should be titled 'how do I display comments on a post?', to which the answer is found in the default theme twentyten/eleven – Tom J Nowell Sep 7 '12 at 23:03

Easiest thing to do is look at twentyten or twentyeleven - each one a default WordPress theme - and see how comment functions are implemented in those. basically, it's a comments.php file, a function in functions.php and a function call in a theme file, i.e. like your home.php.

You may have to revert to the standard WordPress loop, too, instead of the new query, which in your case has no advantages over the standard loop. There's nothing out of the ordinary in your home.php file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.