Title: Adding comments to template
Last modified: April 30, 2020

---

# Adding comments to template

 *  [thetoolman123](https://wordpress.org/support/users/thetoolman123/)
 * (@thetoolman123)
 * [6 years ago](https://wordpress.org/support/topic/adding-comments-to-template/)
 * Hi there,
 * I have created a template for some pages on my website.
 * I would now like users to be able to post comments on pages using this template.
 * Can anyone tell me the code I need to display the comments and the form for users
   to fill out so I can add it to my template?
 * Thank you!

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

 *  [Ketan Vyawahare](https://wordpress.org/support/users/ketanvyawahare/)
 * (@ketanvyawahare)
 * [6 years ago](https://wordpress.org/support/topic/adding-comments-to-template/#post-12758008)
 * Hi [@thetoolman123](https://wordpress.org/support/users/thetoolman123/) ,
 * Refer the link below for the function comment_form() for displaying the form 
   for adding comments on the respective pages.
 * [https://developer.wordpress.org/reference/functions/comment_form/](https://developer.wordpress.org/reference/functions/comment_form/)
 * Please let us know if your response on this.
 *  [Matias Mann](https://wordpress.org/support/users/developress/)
 * (@developress)
 * [6 years ago](https://wordpress.org/support/topic/adding-comments-to-template/#post-12758470)
 * [@ketanvyawahare](https://wordpress.org/support/users/ketanvyawahare/), it will
   depend on how you implemented the code but something like this:
 *     ```
       // Inside the loop
       // If comments are open or we have at least one comment, load up the comment template.
       if ( comments_open() || get_comments_number() ) :
       comments_template();
       endif;
       ```
   

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

The topic ‘Adding comments to template’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 3 participants
 * Last reply from: [Matias Mann](https://wordpress.org/support/users/developress/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/adding-comments-to-template/#post-12758470)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
