WordPress: Template Tags/comments number:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
无编辑摘要
 
第1行: 第1行:
== Description ==
== 描述 ==
== 描述 ==
Displays the total number of comments, [[WordPress:Glossary#Trackback|Trackbacks]], and [[WordPress:Glossary#PingBack|Pingbacks]] for a post. This tag must be within [[WordPress:The Loop]].


显示评论的总数,文章的[[WordPress:Glossary#Trackback|Trackbacks]], 和[[WordPress:Glossary#PingBack|Pingbacks]]。必须在[[WordPress:The Loop|The Loop]]内部使用这个标签。
显示评论的总数,文章的[[WordPress:Glossary#Trackback|Trackbacks]], 和[[WordPress:Glossary#PingBack|Pingbacks]]。必须在[[WordPress:The Loop|The Loop]]内部使用这个标签。
== Usage ==


== 用法 ==
== 用法 ==


%%% <?php comments_number('zero', 'one', 'more'); ?> %%%
%%% <?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  个回应'''。
根据评论的数目,显示文本:评论数目为零- '''没有回应'''; 评论数目为一 - '''一个回应''';多于一个评论(总共42个评论)显示'''42  个回应'''。
第28行: 第15行:
  &lt;p&gt;This post currently has  
  &lt;p&gt;This post currently has  
  <?php comments_number('no responses','one response','% responses'); ?>.&lt;/p&gt;  
  <?php comments_number('no responses','one response','% responses'); ?>.&lt;/p&gt;  
&lt;p&gt;This post currently has
<?php comments_number('没有回应','一个回应','% responses'); ?>.&lt;/p&gt;
== Parameters ==


== 参数 ==
== 参数 ==


; zero : (''string'') Text to display when there are no comments. Defaults to <tt>'No Comments'</tt>.
; zero : (''string'')没有评论时候,显示的文本。默认<tt>'没有评论'</tt>。
; one : (''string'') Text to display when there is one comment. Defaults to <tt>'1 Comment'</tt>.
; one : (''string'') 有一个评论时候,显示的文本。默认<tt>'1 个评论'</tt>。
; more : (''string'') Text to display when there is more than one comment. <tt>%</tt> is replaced by the number of comments, so <tt>'% so far'</tt> is displayed as "5 so far" when there are five comments. Defaults to <tt>'% Comments'</tt>.
; more : (''string'') 不止一个评论时候,显示的文本。<tt>%</tt> 被评论数目代替,因此,当有五个评论的时候,<tt>'% so far'</tt> 显示为 "5 so far" 。默认 <tt>'% 评论'</tt>。
 
 
; 零 : (''string'') 没有评论时候,显示的文本。默认<tt>'没有评论'</tt>。
; 一个 : (''string'') 有一个评论时候,显示的文本。默认<tt>'1 个评论'</tt>。
; 更多的 : (''string'') 不止一个评论时候,显示的文本。<tt>%</tt> 被评论数目代替,因此,当有五个评论的时候,<tt>'% so far'</tt> 显示为 "5 so far" 。默认 <tt>'% 评论'</tt>。
 
== Related ==
 
{{Tag Comments Tags}}
 
{{PHP Function Tag Footer}}
 


== 相关的 ==
== 相关的 ==

2008年7月11日 (五) 11:14的最新版本

描述[ ]

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

用法[ ]

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

例子[ ]

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

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

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

参数[ ]

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

相关的[ ]

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 函数 标签 页底文字