[WordPress] 外掛分享: Recent Comments

首頁外掛目錄 › Recent Comments
200+
安裝啟用
尚無評分
1859 天前
最後更新
問題解決
v2.1 上架:2005-01-12

內容簡介

建立一些功能,協助顯示最近的評論列表。提供比 WordPress 預設的小工具更多的可設定選項。

設定

您可以在呼叫函式時傳遞參數以配置一些選項。這些參數僅接受query-string-style格式。

list_most_recent_comments()

除了get_comments()和get_most_recent_comments()(見下文)接受的參數外,此函式還接受以下參數:

excerpt_words — 顯示評論中的單字數
excerpt_chars — 或者從評論中顯示的字符數
comment_format — 允許您從兩種預定義的顯示格式中選擇:

評論作者在文章標題下
評論作者:這是評論摘要

例子:

<?php list_most_recent_comments( 'excerpt_words=5' ); ?>

get_most_recent_comments()

較強大的get_comments()版本。它接受相同參數以及以下參數:

passworded_posts — 用於控制是否顯示密碼保護的文章的布林值。默認為false。
showpings — 用於控制是否顯示平側響應和引用的布林值。默認為false。
post_types — 用於包括評論的文章類型數組。默認為文章和頁面:array( 'post', 'page' )
post_statuses — 用於包含評論的文章狀態數組。默認為已發布的文章和靜態頁面:array( 'publish', 'static' )

參數應該通過數組而不是字符串傳遞。

例子:

<?php

list_most_recent_comments( array(
'showpings' => true,
'post_types' => array( 'post', 'page', 'foobar' ),
) );

?>

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Recent Comments」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Creates functions to assist in displaying a list of the most recent comments. Provides more configurability than the widget that comes with WordPress.
Configuration
You may pass parameters when calling the function to configure some of the options. Parameters are accepted only in the query-string-style.
list_most_recent_comments()
In addition to the parameters that get_comments() and get_most_recent_comments() (see below) accept, this function accepts the following parameters:

excerpt_words — The number of words from the comment to display
excerpt_chars — Or alternately the number of characters from the comment to display
comment_format — Allows you to pick from two predefined display formats:

Comment Author on Post Title
Comment Author: This is the comment excerpt

Example:

get_most_recent_comments()
A more powerful version of get_comments(). It accepts the same parameters as well as the following ones:

passworded_posts — Boolean to control showing comments on passworded posts or not. Defaults to false.
showpings — Boolean to control showing pings and trackbacks or not. Defaults to false.
post_types — Array of post types to include comments from. Defaults to posts and pages: array( 'post', 'page' )
post_statuses — Array of post statuses to include comments from. Defaults to published posts and static pages: array( 'publish', 'static' )

Arguments should likely be passed as an array instead of a string.
Example:
true,
'post_types' => array( 'post', 'page', 'foobar' ),
) );

?>

延伸相關外掛

文章
Filter
Apply Filters
Mastodon