WordPress: Template Tags/comments popup link:修订间差异
(新页面: == Description == Displays a link to the comments popup window if comments_popup_script() is used, otherwise it displays a normal link t...) |
无编辑摘要 |
||
第1行: | 第1行: | ||
== Description == | == Description == | ||
== 描述 == | |||
Displays a link to the comments popup window if [[WordPress:Template_Tags/comments_popup_script|comments_popup_script()]] is used, otherwise it displays a normal link to comments. This tag must be within [[WordPress:The Loop]], or a comment loop, and it does nothing if [[WordPress:Conditional_Tags#A_Single_Post_Page | is_single()]] or [[WordPress:Conditional_Tags#A_PAGE_Page | is_page()]] is true (even when within [[WordPress:The Loop]]). | Displays a link to the comments popup window if [[WordPress:Template_Tags/comments_popup_script|comments_popup_script()]] is used, otherwise it displays a normal link to comments. This tag must be within [[WordPress:The Loop]], or a comment loop, and it does nothing if [[WordPress:Conditional_Tags#A_Single_Post_Page | is_single()]] or [[WordPress:Conditional_Tags#A_PAGE_Page | is_page()]] is true (even when within [[WordPress:The Loop]]). | ||
如果使用[[WordPress:Template_Tags/comments_popup_script|评论_弹出_脚本()]],显示一个链接,连接到评论弹出窗口,否则,就显示一个普通的链接,连接到评论。必须在[[WordPress:The Loop|The Loop]]内部或者一个评论 loop内部使用这个标签,如果[[WordPress:Conditional_Tags#A_Single_Post_Page | is_single()]] or [[WordPress:Conditional_Tags#A_PAGE_Page | is_page()]]是正确的(即使是在[[WordPress:The Loop|The Loop]]内部),标签什么任务也不会执行。 | |||
== Usage == | == Usage == | ||
== 用法 == | |||
%%% <?php comments_popup_link | |||
('zero','one','more','CSSclass','none'); | |||
?> %%% | |||
%%% <?php comments_popup_link | %%% <?php comments_popup_link | ||
第10行: | 第20行: | ||
== Examples == | == Examples == | ||
== 例子 == | |||
===Text Response for Number of Comments=== | ===Text Response for Number of Comments=== | ||
===对于评论数目,文本做出的反应=== | |||
Displays the comments popup link, using "No comments yet" for no comments, "1 comment so far" for one, "% comments so far (is that a lot?)" for more than one (% replaced by # of comments), and "Comments are off for this post" if commenting is disabled. Additionally, <tt>'comments-link'</tt> is a custom [[WordPress:Glossary#CSS|CSS]] class for the link. | Displays the comments popup link, using "No comments yet" for no comments, "1 comment so far" for one, "% comments so far (is that a lot?)" for more than one (% replaced by # of comments), and "Comments are off for this post" if commenting is disabled. Additionally, <tt>'comments-link'</tt> is a custom [[WordPress:Glossary#CSS|CSS]] class for the link. | ||
显示评论弹出窗口链接,对于零个评论,使用"还没有评论",对于一个评论,使用"我评论了","% 迄今有这麽多评论 (is that a lot?)" 对于不止一个评论 (% 由 #评论代替), "关于这篇文章的评论已经关闭了" 如果拥有评论,是不能发表的。此外,<tt>'评论-链接'</tt>是一个关于链接的自定义[[WordPress:Glossary#CSS|CSS]] class。 | |||
<p><?php comments_popup_link('No comments yet', '1 comment so far', | <p><?php comments_popup_link('No comments yet', '1 comment so far', | ||
'% comments so far (is that a lot?)', 'comments-link', 'Comments are | '% comments so far (is that a lot?)', 'comments-link', 'Comments are | ||
off for this post'); ?></p> | off for this post'); ?></p> | ||
<p><?php 评论_弹出_链接('还没有评论', '我发表了评论', | |||
'%评论(很多吗?)', '评论-链接', '关于这篇文章的评论已经关闭了'); ?></p> | |||
===Hide Comment Link When Comments Are Deactivated=== | ===Hide Comment Link When Comments Are Deactivated=== | ||
===当评论已经被取消的时候,隐藏评论链接=== | |||
Hides the paragraph element <p></p> that contains the comments_popup_link when comments are deactivated in the Write>Post screen. Good for those who want enable/disable comments post by post. Must be used in the loop. | Hides the paragraph element <p></p> that contains the comments_popup_link when comments are deactivated in the Write>Post screen. Good for those who want enable/disable comments post by post. Must be used in the loop. | ||
隐藏段落元素<p></p>;当写>文章界面的评论功能取消了之后,<p></p>包含有评论_弹出_链接。对于那些想要一篇文章一篇文章地激活/取消评论的人的操作,有益。必须用在loop中。 | |||
<?php if ( comments_open() ) : ?><br /><p><br /><?php comments_popup_link( 'No comments yet', '1 comment', '% comments so far', 'comments-link', 'Comments are off for this post'); ?><br /></p><br /><?php endif; ?> | <?php if ( comments_open() ) : ?><br /><p><br /><?php comments_popup_link( 'No comments yet', '1 comment', '% comments so far', 'comments-link', 'Comments are off for this post'); ?><br /></p><br /><?php endif; ?> | ||
<?php if ( comments_open() ) : ?><br /><p><br /><?php comments_popup_link( '还没有评论', '1 个评论', '% comments so far', 'comments-link', '关于这篇文章的评论功能关闭了'); ?><br /></p><br /><?php endif; ?> | |||
== Parameters == | == Parameters == | ||
== 参数 == | |||
; zero : (''string'') Text to display when there are no comments. Defaults to <tt>'No Comments'</tt>. | ; zero : (''string'') Text to display when there are no comments. Defaults to <tt>'No Comments'</tt>. | ||
第32行: | 第59行: | ||
; CSSclass : (''string'') CSS (stylesheet) class for the link. This has no default value. | ; CSSclass : (''string'') CSS (stylesheet) class for the link. This has no default value. | ||
; none : (''string'') Text to display when comments are disabled. Defaults to <tt>'Comments Off'</tt>. | ; none : (''string'') Text to display when comments are disabled. Defaults to <tt>'Comments Off'</tt>. | ||
; 零 : (''string'') 没有评论的时候,显示的文本。默认<tt>'没有评论'</tt>。 | |||
; 一个 : (''string'') 只有一个评论的时候,需要显示的文本。默认<tt>'1个评论'</tt>。 | |||
; 更多的 : (''string'') 不止一个评论的时候,显示的文本。<tt>'%'</tt>被评论的数目所代替, 因此 ,当有五个评论的时候,<tt>'% so far'</tt> 显示为 "5 so far" 。默认 <tt>'% 评论 | |||
'</tt>. | |||
; CSSclass : (''string'') 链接的CSS (样式表) 。没有默认值。 | |||
; 没有 : (''string'') 当取消评论的时候,显示的文本。默认<tt>'关闭评论'</tt>。 | |||
== Related == | == Related == | ||
第38行: | 第76行: | ||
{{PHP Function Tag Footer}} | {{PHP Function Tag Footer}} | ||
== 相关的 == | |||
{{标签 评论 标签 }} | |||
{{PHP 函数 标签 页底文字}} |
2008年7月1日 (二) 16:30的版本
Description
描述
Displays a link to the comments popup window if comments_popup_script() is used, otherwise it displays a normal link to comments. This tag must be within WordPress:The Loop, or a comment loop, and it does nothing if is_single() or is_page() is true (even when within WordPress:The Loop).
如果使用评论_弹出_脚本(),显示一个链接,连接到评论弹出窗口,否则,就显示一个普通的链接,连接到评论。必须在The Loop内部或者一个评论 loop内部使用这个标签,如果 is_single() or is_page()是正确的(即使是在The Loop内部),标签什么任务也不会执行。
Usage
用法
%%% <?php comments_popup_link ('zero','one','more','CSSclass','none'); ?> %%%
%%% <?php comments_popup_link ('zero','one','more','CSSclass','none'); ?> %%%
Examples
例子
Text Response for Number of Comments
对于评论数目,文本做出的反应
Displays the comments popup link, using "No comments yet" for no comments, "1 comment so far" for one, "% comments so far (is that a lot?)" for more than one (% replaced by # of comments), and "Comments are off for this post" if commenting is disabled. Additionally, 'comments-link' is a custom CSS class for the link.
显示评论弹出窗口链接,对于零个评论,使用"还没有评论",对于一个评论,使用"我评论了","% 迄今有这麽多评论 (is that a lot?)" 对于不止一个评论 (% 由 #评论代替), "关于这篇文章的评论已经关闭了" 如果拥有评论,是不能发表的。此外,'评论-链接'是一个关于链接的自定义CSS class。
<p><?php comments_popup_link('No comments yet', '1 comment so far', '% comments so far (is that a lot?)', 'comments-link', 'Comments are off for this post'); ?></p>
<p><?php 评论_弹出_链接('还没有评论', '我发表了评论',
'%评论(很多吗?)', '评论-链接', '关于这篇文章的评论已经关闭了'); ?></p>
Hide Comment Link When Comments Are Deactivated
当评论已经被取消的时候,隐藏评论链接
Hides the paragraph element <p></p> that contains the comments_popup_link when comments are deactivated in the Write>Post screen. Good for those who want enable/disable comments post by post. Must be used in the loop.
隐藏段落元素<p></p>;当写>文章界面的评论功能取消了之后,<p></p>包含有评论_弹出_链接。对于那些想要一篇文章一篇文章地激活/取消评论的人的操作,有益。必须用在loop中。
<?php if ( comments_open() ) : ?>
<p>
<?php comments_popup_link( 'No comments yet', '1 comment', '% comments so far', 'comments-link', 'Comments are off for this post'); ?>
</p>
<?php endif; ?>
<?php if ( comments_open() ) : ?>
<p>
<?php comments_popup_link( '还没有评论', '1 个评论', '% comments so far', 'comments-link', '关于这篇文章的评论功能关闭了'); ?>
</p>
<?php endif; ?>
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 are more than one comments. '%' is replaced by the number of comments, so '% so far' is displayed as "5 so far" when there are five comments. Defaults to '% Comments'.
- CSSclass
- (string) CSS (stylesheet) class for the link. This has no default value.
- none
- (string) Text to display when comments are disabled. Defaults to 'Comments Off'.
- 零
- (string) 没有评论的时候,显示的文本。默认'没有评论'。
- 一个
- (string) 只有一个评论的时候,需要显示的文本。默认'1个评论'。
- 更多的
- (string) 不止一个评论的时候,显示的文本。'%'被评论的数目所代替, 因此 ,当有五个评论的时候,'% so far' 显示为 "5 so far" 。默认 '% 评论
'.
- CSSclass
- (string) 链接的CSS (样式表) 。没有默认值。
- 没有
- (string) 当取消评论的时候,显示的文本。默认'关闭评论'。
Related
相关的
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