WordPress:Template Tags/comments number

来自站长百科
Fludlen讨论 | 贡献2008年7月1日 (二) 16:22的版本
跳转至: 导航、​ 搜索

Description

描述

Displays the total number of comments, Trackbacks, and Pingbacks for a post. This tag must be within WordPress:The Loop.

显示评论的总数,文章的Trackbacks, 和Pingbacks。必须在The Loop内部使用这个标签。

Usage

用法

%%% <?php comments_number('zero', 'one', 'more'); ?> %%%

%%% <?php comments_number('零', '一', '更多'); ?> %%%

Examples

例子

Text Response to Number of Comments

对于评论数目,文本的回应

Displays text based upon number of comments: Comment count zero - no reponses; comment count one - one response; more than one comment (total 42) displays 42 responses.

根据评论的数目,显示文本:评论数目为零- 没有回应; 评论数目为一 - 一个回应;多于一个评论(总共42个评论)显示42 个回应

<p>This post currently has 
<?php comments_number('no responses','one response','% responses'); ?>.</p> 

<p>This post currently has

<?php comments_number('没有回应','一个回应','% responses'); ?>.</p> 

Parameters

参数

zero
(string) Text to display when there are no comments. Defaults to 'No Comments'.
one
(string) Text to display when there is one comment. Defaults to '1 Comment'.
more
(string) Text to display when there is more than one comment. % is replaced by the number of comments, so '% so far' is displayed as "5 so far" when there are five comments. Defaults to '% Comments'.


(string) 没有评论时候,显示的文本。默认'没有评论'
一个
(string) 有一个评论时候,显示的文本。默认'1 个评论'
更多的
(string) 不止一个评论时候,显示的文本。% 被评论数目代替,因此,当有五个评论的时候,'% so far' 显示为 "5 so far" 。默认 '% 评论'

Related

模板:Tag Comments Tags

模板:PHP Function Tag Footer


相关的

comments_number, comments_link, comments_rss_link, comments_popup_script, comments_popup_link, comment_ID, comment_author, comment_author_IP, comment_author_email, comment_author_url, comment_author_email_link, comment_author_url_link, comment_author_link, comment_type, comment_text, comment_excerpt, comment_date, comment_time, comments_rss_link, comment_author_rss, comment_text_rss, comment_link_rss, permalink_comments_rss

模板:PHP 函数 标签 页底文字