display comment form for specific post id

I have three pages, and I want them all to display the comments form from a post with id=343. What code would I use within the pages to make that happen?

Here is what I’ve tried:

Read More
<?php
$id=343; // sample, I get the latest post id of a particular category
comments_template();
?>

But that doesn’t work, it just shows the blank comment form from the page. Any thoughts / suggestions?

Related posts

Leave a Reply

2 comments

  1. Use get_comments() and pass the post ID as parameter:

    $comments = get_comments(
        array (
            'post_id' => 343
        ) 
    );
    
    foreach ( $comments as $comment )
    {
        // Just to give you an idea of the available data.
        // You will probably do something better with it. :)
        var_export( $comment );
    }
    

    Related: Bug #20572 ($post_id not passed to comment_open() from comment_form()) was fixed just two days ago.