Codex

Function Reference/comments template

Contents

Description

Loads the comment template. For use in single post and page displays.

Usage

<?php comments_template$file$separate_comments ); ?>

Parameters

$file
(string) (optional) The file to load
Default: /comments.php
$separate_comments
(boolean) (optional) Whether to separate the comments by comment type.
Default: false

Examples

Notes

  • Uses global: (array) $comment List of comment objects for the current post
  • Uses: $wpdb
  • Uses: $id
  • Uses: $post
  • Uses: $withcomments Will not try to get the comments if the post has none.

Change Log

Since: 1.5.0

Source File

comments_template() is located in wp-includes/comment-template.php.

Related

get_header, get_sidebar, get_search_form, comments_template, get_footer

See also index of Function Reference and index of Template Tags.