perch_blog_post_comments()
Displays comments for a given post.
Requires
- The Blog App installed
Parameters
| Type | Description |
|---|---|
| ID or Slug | the ID or slug of your post |
| Array | Options array, see table below |
| Boolean | Set to true to have the value returned instead of echoed. |
Options array
| Name | Value |
|---|---|
| template | The template to use. |
| sort | The ID of the field to sort by (detault: commentDateTime) |
| sort-order | ASC/DESC |
| paginate | True or false. Whether to use pagination. |
| count | Integer. (When used with paginate) The number of items to show per page if pagination is being used. |
| pagination-var | The URL query string parameter name to use for the page number. Defaults to page. |
| page-links | True or false. Create numbered page links as well as previous and next links. |
| page-link-template | The template to use (if not the default) to generate the page links. |
| page-link-style | shortened or all. By default a shortened set of page links are generated. If you want a link for every page, set to all. |
Usage examples
The first argument must be either the ID of a post, or a unique post slug. Usually this will have been passed on the URL from a blog listing page.
<?php perch_blog_post_comments(perch_get('s')); ?>
An options array can be used to pass in an alternate template.
<?php
perch_blog_post_comments(perch_get('s'), array(
'template' => 'comment.html',
));
?>