编辑“WordPress:Template Tags/comments number

跳转至: 导航、​ 搜索
警告:您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您登录创建一个账户,您的编辑将归属于您的用户名,且将享受其他好处。

该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。

最后版本 您的文本
第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  个回应'''。
第15行: 第28行:
  &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'')没有评论时候,显示的文本。默认<tt>'没有评论'</tt>。
; zero : (''string'') Text to display when there are no comments. Defaults to <tt>'No Comments'</tt>.
; one : (''string'') 有一个评论时候,显示的文本。默认<tt>'1 个评论'</tt>。
; one : (''string'') Text to display when there is one comment. Defaults to <tt>'1 Comment'</tt>.
; more : (''string'') 不止一个评论时候,显示的文本。<tt>%</tt> 被评论数目代替,因此,当有五个评论的时候,<tt>'% so far'</tt> 显示为 "5 so far" 。默认 <tt>'% 评论'</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>.
 
 
; 零 : (''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}}
 


== 相关的 ==
== 相关的 ==
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅Wordpress-mediawiki:版权的细节)。 未经许可,请勿提交受版权保护的作品!
取消 编辑帮助(在新窗口中打开)