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 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