[WordPress] 外掛分享: WP Specific Comment

首頁外掛目錄 › WP Specific Comment
全新外掛
安裝啟用
尚無評分
6194 天前
最後更新
問題解決
WordPress 2.0+ v1.0 上架:2009-04-29

內容簡介

WP Specific Comment 為您的主題提供一個可在任何地方使用(包括迴圈內外)的模板標籤。此模板標籤將返回一個特定評論的物件,您可以從中檢索任何標準評論數據。

模板標籤

要啟動此外掛,請將 <?php wp_specific_comment($ID); ?> 放入您的主題中,其中 $ID 將是您要返回的評論的 ID 號碼。

例如:

<?php wp_specific_comment(44); ?> 會返回ID為44的評論。非常簡單,不是嗎?

注意:此模板標籤實際上不會顯示任何內容。它僅設置要顯示的評論。您必須添加其他標準 WordPress 模板標籤才能在您的博客中顯示任何內容。詳細的可用評論標籤列表請參見此處。

例如:

<?php wp_specific_comment(1); ?> <h5 class="comment_author"><?php comment_author_link(); ?></h5> <div class="comment_text"><?php comment_text(); ?></div>

上述代碼將檢索 ID 為 1 的評論,然後在 <h5> 中顯示其作者(如果提供,則連結到作者的 URL),之後在 <div> 中包含評論的文本內容。真的非常簡單!

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

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

原文外掛簡介

WP Specific Comment provides a template tag for use anywhere in your theme, inside or outside The Loop. This template tag will return a specific comment as an object, from which you can retrieve any standard comment data.
Template Tag
To initiate the plugin, place into your theme, where $ID will be the ID number for the comment you want returned.
Example:
will return the comment with the ID of 44. Pretty simple, right?
Note: This template tag will not actually display anything. It only sets up a comment to be displayed. You’ll have to add in some other standard WordPress Template Tags to get anything to show up on your blog. List of available Comment Tags can be found here.
Example:

The above code would retrieve comment with ID of 1, and then display its author (linked to the author’s URL, if provided) in a

followed by a

containing the comment’s text content. Still pretty simple!

延伸相關外掛

文章
Filter
Apply Filters
Mastodon