Question: My wordpress makes use of custom post templates. I'm now trying to create a custom comments template as well.

I noticed that the comments template is called via this function
`<?php comments_template( '', true ); ?>`

I checked in my functions.php and comments.php but don't see the function being declared anywhere. Can someone please advise on how to go about introducing a custom comments template?

Answer: 
The [`comments_template()`](http://codex.wordpress.org/Function_Reference/comments_template) template tag sets up the commenting variables and functions, and includes the `comments.php` template-part file. So, to create a custom comments template, use `comments.php`.

From there, you will need to get comfortable with the arguments, filters, and callbacks for [`wp_list_comments()`](http://codex.wordpress.org/Function_Reference/wp_list_comments), which is used to output the comment list, and [`comment_form()`](http://codex.wordpress.org/Function_Reference/comment_form), which is used to output the comment-reply form.
You can use the callback function on wp\_list\_comments() function.

```
wp_list_comments();

```

Usually, you will find this line in comments.php file of your wordpress theme. And the output from this command is a pretty straightforward HTML structure.

Wordpress have a option of passing the callback function as an argument to wp\_list\_comments function.

This callback function should return the modified HTML structure of comments section, which we are looking to implement.

```
<ul class="comment-list comments">
    <?php
    wp_list_comments( array(
        'style'      => 'ul',
        'short_ping' => true,
            'callback' => 'better_comments'
    ) );
     ?>
</ul><!-- .comment-list -->

```

You can check detailed tutorial here

<https://www.5balloons.info/custom-html-for-comments-section-in-wordpress-theme/>