Title: Create Custom Comment Form
Last modified: August 19, 2016

---

# Create Custom Comment Form

 *  Resolved [skarck](https://wordpress.org/support/users/skarck/)
 * (@skarck)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/create-custom-comment-form/)
 * Hi!
 * I’m developing some kind of a photo gallery and need to display a comment form
   that will write comments to the DB. But I wanna decide things like the comment_post_ID
   by form fields. so i copied the redered html of the normal coment form and tried
   some stuff but it doesn’t work…
 * this is my code:
 *     ```
       <form method="post" action="<?php bloginfo('url'); ?>/wp-comments-post.php">
             <input type="hidden" name="SOME-VALUE" value="<?php echo $MY-COMMENT-POST-ID; ?>" />
             <input type="text" name="author" id="author" value="User-1" />
             <input type="text" id="comment" name="comment" />
             <input type="submit"/>
             </form>
       ```
   
 * btw. i’m not using the loop…
 * i appreciate any help!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [carlla](https://wordpress.org/support/users/carlla/)
 * (@carlla)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/create-custom-comment-form/#post-1665268)
 * Do you wanna only one comment form for the gallery? (not a form for each photo?)
   If so you may considere create a page for the gallery and install the comment
   form (comments.php) on the page template (page-idpage.php)
 * I don’t know if I understand your question =/
 *  Thread Starter [skarck](https://wordpress.org/support/users/skarck/)
 * (@skarck)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/create-custom-comment-form/#post-1665483)
 * thanks, i already fixed it by myself:
    what i wanted to do is a comment form 
   per photo. i set an hidden input of `name="comment_post_id"` to the attachment-
   id. what i missed was an `id="commentform"` in the `<form>` WP needs for validation…

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Create Custom Comment Form’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [skarck](https://wordpress.org/support/users/skarck/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/create-custom-comment-form/#post-1665483)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
