如何在WordPress自定义PHP模板上调用特定帖子的comment_form()

I'm amending a template file that loops through a number of posts similar to an archive page in WordPress. On that output I can show the comments already submitted using get_comments and wp_list_comments. However I cannot for the life of me get the comment form to output. I've tried many different varieties of comment_form() with args submitting the page_id but to no avail I either break the page or it just doesn't appear. Comments are definitely open and commenting is possible but just not showing on the page.

comment_form($featuredposts[$articlePageNo]->ID);

doesn't break my page but is comming back with no form.

comment_form(post_id => $featuredposts[$articlePageNo]->ID);

breaks the page. I think this might be down to the prevention of comment_form displaying on non single pages within WordPress but I can't seem to isolate how to tell WordPress it's ok to do it on mine.

comment_form($featuredposts[$articlePageNo]->ID); //ID is the post ID from my loop.

//This works for displaying the already submitted comments:
//Gather comments for a specific page/post
$comments = get_comments(array(
      'post_id' => $postIDD,
      'status' => 'approve' //Change this to the type of comments to be displayed
       ));
//Display the list of comments
wp_list_comments(array(
             'per_page' => 10, //Allow comment pagination
             'reverse_top_level' => false //Show the latest comments at the 
top of the list
             ), $comments);

comment_form() actually takes a post id as the second argument, as described in the Developer Documentation. (if you don't give a post ID it uses the post ID of the current page)

So try to pass the ID as the second parameter like so:

comment_form(null, $featuredposts[$articlePageNo]->ID);

So it's not an easy fix that I could find, went round the houses to get a solution but posting here what I found so that future me can know how to do it. In the end I output a form to process the comments. I stripped out a number of fields but you'll get the idea. It does send you to the posts page upon submission but that's one for another day.

<form id="commentform" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<div class="commentform-element">
<label class="hide" for="comment"></label>
<textarea id="comment" class="input-fields" name="comment" cols="40" rows="3"></textarea>
</div>
<input name="submit" class="form-submit-button"  type="submit" id="submit-comment" value="Post">
<input type="hidden" name="comment_post_ID" value="<?php echo $featuredposts[$articlePageNo]->ID; ?>" id="comment_post_ID">
<input type="hidden" name="comment_parent" id="comment_parent" value="0">
</form>