Primary

Shortcodes

Decent Comments provides the [decent_comments] shortcode that can be used to embed comments anywhere.

If no attributes are given, the default settings are used.

Usage

Place the following shortcode anywhere on a page to show comments based on the default settings:

[decent_comments]

As an example using customized settings, place the following shortcode anywhere to show 25 comments featuring 64 pixel avatars:

[decent_comments number="25" avatar_size="64"]

Shortcode Attributes

The [decent_comments] shortcode supports the following attributes.

ellipsis

This is shown after a comment’s excerpt, if there are more words in the comment than shown in the excerpt.

Default : …

exclude_post_author

Set this to true if comments on posts from the post’s author should not be included.

Default : false

excerpt

Default : true

max_excerpt_words

Determines up to how many words are shown as an excerpt for each comment.

Default : 20

max_excerpt_characters

Determines up to how many characters are shown as an excerpt for each comment.

Default : 0

strip_tags

Whether HTML tags will be removed or retained in the comment’s excerpt.

Default : true

avatar_size

The avatar size in pixels.

Default : 24

number

The maximum number of comments to show.

Default : 5

orderby

The criterion used to sort comments.

Default : "comment_date_gmt"

Possible values:
"comment_author_email" : Author Email
"comment_author_url" : Author URL
"comment_content" : Content
"comment_date_gmt" : Date
"comment_karma" : Karma
"comment_post_ID" : Post

order

Whether to use ascending or descending order, sorting the comments as per the orderby given.

Default : "DESC"

Possible values: "ASC", "DESC"

post_id

If empty, shows comments from anywhere on your site, based on the criterion chosen. You can enter part of the title of a post or a post’s ID to only show comments related to a specific post. You can enter [current] or {current} to show comments for the post that is currently displayed.

Possible values:

  • "{current}" : show comments for the current post
    Usage: [decent_comments post_id="{current}"]
  • a post ID : show comments for a specific post
    For example: [decent_comments post_id="123"]

show_author

Default : true

link_author

Whether to link comment authors to their website.

Default : true

show_avatar

Whether to show the avatar of the comment author.

Default : true

show_date

Whether to display the date a comment was posted.

Default : true

show_link

Whether to display a link to the post on which the comment was posted.

Default : true

show_comment

Whether to show the comment.

Default : true

taxonomy

Used to show comments on posts related to certain taxonomies. Use category for categories or post_tag for tags.

Default : empty

terms

Used with the taxonomy option, indicate a comma-separated list of term slugs to show comments for all posts related to these terms.

Default : empty

trackback

Whether to include trackbacks.

Default : true

pingback

Whether to include pingbacks.

Default : true