wp_list_comments


wp_list_comments ( $args = array(), $comments = null )

Parameters:
  • (string|array) args { Optional. Formatting options. @type object $walker Instance of a Walker class to list comments. Default null. @type int $max_depth The maximum comments depth. Default empty. @type string $style The style of list ordering. Default 'ul'. Accepts 'ul', 'ol'. @type string $callback Callback function to use. Default null. @type string $end-callback Callback function to use at the end. Default null. @type string $type Type of comments to list. Default 'all'. Accepts 'all', 'comment', 'pingback', 'trackback', 'pings'. @type int $page Page ID to list comments for. Default empty. @type int $per_page Number of comments to list per page. Default empty. @type int $avatar_size Height and width dimensions of the avatar size. Default 32. @type bool $reverse_top_level Ordering of the listed comments. If true, will display newest comments first. @type bool $reverse_children Whether to reverse child comments in the list. Default null. @type string $format How to format the comments list. Default 'html5' if the theme supports it. Accepts 'html5', 'xhtml'. @type bool $short_ping Whether to output short pings. Default false. @type bool $echo Whether to echo the output or return it. Default true. }
  • (WP_Comment[]) comments Optional. Array of WP_Comment objects.
See:
Returns:
  • (void|string) Void if 'echo' argument is true, or no comments to list. Otherwise, HTML list of comments.
Defined at:

Description

Displays a list of comments.Used in the comments.php template to list comments for a particular post.

Related Functions

wp_list_cats, wp_trash_post_comments, wp_ajax_get_comments, wp_ajax_edit_comment, wp_list_widgets

Top Google Results

User discussions

wpseek mobile