Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Has anyone run across a way to build a page of posts that includes the comments and discussion form(s) for each post inline with the list?

I tried this a few ways today and found it quite difficult.

For example the list would be pseudo-code like

POSTS ARRAY
POST[1]
COMMENTS ARRAY 
POST[2
COMMENTS ARRAY
...

One of the ways I tried to accomplish this (which seemed the easiest really) was to use single.php as a page template and then just run a manual query_posts in it.

I was able to get it to work by calling comment_form('', the_ID()); instead of comments_template( 'comments.php', true );

HOWEVER that solution does NOT use my comments template and rather throws this div in there with an id of "respond" that isn't anywhere in my theme.

There is some magic that happens on a page or single that you can't easily override when you try to do it in one big list.

Any help would be appreciated and respected.

/*
Template Name: Blog
*/
?>
<?php 

get_header();

$args = array(
'category' => '7',
'posts_per_page' => '10',
);
query_posts( $args );

?>
<div id="content">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    <div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>

        <article>
            <h1><a href="<?php the_permalink() ?>" title="<?php        the_title(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
            <?php edit_post_link('<small>Edit this entry</small>','',''); ?>
            <?php if ( has_post_thumbnail() ) { /* loades the post's featured thumbnail, requires Wordpress 3.0+ */ echo '<div class="featured-thumbnail">'; the_post_thumbnail(); echo '</div>'; } ?>
            <div class="post-content">
                <?php the_content(); ?>
                <?php wp_link_pages('before=<div class="pagination">&after=</div>'); ?>
            </div><!--.post-content-->
        </article>

        <div id="post-meta">
            <p>
                Posted on <?php the_time('F j, Y'); ?> at <?php the_time() ?>
            </p>

            <p>
                <?php the_tags('Tags: ', ', ', ' '); ?>
            </p>
            <p>
                Receive new post updates: <a href="<?php bloginfo('rss2_url'); ?>" rel="nofollow">Entries (RSS)</a>
                <br />
                Receive follow up comments updates: <?php comments_rss_link('RSS 2.0'); ?>
            </p>
        </div><!--#post-meta-->

        <?php /* If a user fills out their bio info, it's included here */ ?>


    </div><!-- #post-## -->



    <?php 
    comment_form('', the_ID());
    //comments_template( 'comments.php', true ); ?>

<?php endwhile; /* end loop */ ?>

share|improve this question

closed as too localized by toscho♦ Feb 18 '13 at 23:45

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.