WordPress: Template Tags/comments number:修订间差异
来自站长百科
无编辑摘要 |
无编辑摘要 |
||
第1行: | 第1行: | ||
== 描述 == | == 描述 == | ||
显示评论的总数,文章的[[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]]内部使用这个标签。 | ||
== 用法 == | == 用法 == | ||
%%% <?php comments_number('zero', 'one', 'more'); ?> %%% | %%% <?php comments_number('zero', 'one', 'more'); ?> %%% | ||
== 例子 == | == 例子 == | ||
===对于评论数目,文本的回应=== | ===对于评论数目,文本的回应=== | ||
根据评论的数目,显示文本:评论数目为零- '''没有回应'''; 评论数目为一 - '''一个回应''';多于一个评论(总共42个评论)显示'''42 个回应'''。 | 根据评论的数目,显示文本:评论数目为零- '''没有回应'''; 评论数目为一 - '''一个回应''';多于一个评论(总共42个评论)显示'''42 个回应'''。 | ||
第28行: | 第15行: | ||
<p>This post currently has | <p>This post currently has | ||
<?php comments_number('no responses','one response','% responses'); ?>.</p> | <?php comments_number('no responses','one response','% responses'); ?>.</p> | ||
== 参数 == | == 参数 == | ||
; zero | ; zero : (''string'')没有评论时候,显示的文本。默认<tt>'没有评论'</tt>。 | ||
; one : (''string'') 有一个评论时候,显示的文本。默认<tt>'1 个评论'</tt>。 | |||
; more : (''string'') 不止一个评论时候,显示的文本。<tt>%</tt> 被评论数目代替,因此,当有五个评论的时候,<tt>'% so far'</tt> 显示为 "5 so far" 。默认 <tt>'% 评论'</tt>。 | |||
; | |||
; | |||
== 相关的 == | == 相关的 == |
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