Rev | Line | |
---|
[44] | 1 | ## comment/
|
---|
| 2 |
|
---|
| 3 | ### Overview
|
---|
| 4 |
|
---|
| 5 | This directory holds templates for displaying a comment in it's entirety. These templates do not hold the comment loop, or the "Comments" title or the form to allow commenting; they just show a single comment.
|
---|
| 6 |
|
---|
| 7 | Typically these templates will be brought in to a template in _comments/_, but can also be used to display single comments as needed.
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | ## Comment Context
|
---|
| 11 |
|
---|
| 12 | When choosing a template to use in the Comment Context, the Carrington engine looks at the type of comment and the author of the comment to choose which template to use.
|
---|
| 13 |
|
---|
| 14 | A "default" template is required, and will be used when there are no other templates that match a given comment. This could be because no other templates have been created, or because the comment in question doesn't match the templates that are available.
|
---|
| 15 |
|
---|
| 16 | The order in which these conditions are checked defaults to the following:
|
---|
| 17 |
|
---|
| 18 | 1. ping
|
---|
| 19 | 2. author
|
---|
| 20 | 3. user
|
---|
| 21 | 4. role
|
---|
| 22 | 5. default
|
---|
| 23 |
|
---|
| 24 | however this order can be overridden with a plugin using the `cfct_comment_match_order` hook.
|
---|
| 25 |
|
---|
| 26 | Once a template match has been found, no other processing is done.
|
---|
| 27 |
|
---|
| 28 |
|
---|
| 29 | ### Supported Templates (Comment Context)
|
---|
| 30 |
|
---|
| 31 | - *comment-default.php* - Used when there are no other templates that match for a given comment.
|
---|
| 32 | - *ping.php* - Used if the comment is a pingback or a trackback.
|
---|
| 33 | - *author.php* - Used when the author of the post leaves a comment.
|
---|
| 34 | - *user-{username}.php* - Used when a user with that username leaves a comment. For example, a template with a file name of _user-jsmith.php_ would be used for a comment by user _jsmith_. Any WordPres username can take the place of {username} in the file name.
|
---|
| 35 | - *role-{role}.php* - Used when a comment is made by a user with a certain role. For example, a template with a file name of _role-subscriber.php_ would be used for a user with a role of "subscriber" (typical for a registered commentor who is not an author or an admin). Any WordPress role can take the place of {role} in the file name. |
---|
Note:
See
TracBrowser
for help on using the repository browser.