comments_popup_link()

WordPress弹出评论链接函数

WordPress模板函数comments_popup_link用于输出弹出评论的链接,当使用了comments_popup_script()函数时,点击该链接可实现弹出窗口评论,如果没有使用comments_popup_script()函数,则输出普通的跳转到评论区域的链接。

由于comments_popup_script()函数在WordPress 4.5版本已弃用,所以comments_popup_link()也变得没有意义。

comments_popup_link( string $zero = false, string $one = false, string $more = false, string $css_class = '', string $none = false )

函数参数

$zero

字符串值,默认值:No Comments

没有评论时显示的内容。

$one

字符串值,默认值:1 Comment

只有一条评论时显示的内容。

$more

字符串值,默认值:% Comments

大于一条评论时显示的内容。

$css_class

字符串值,默认值为空

链接的class类名称

$none

字符串值,默认值:Comments Off

评论关闭时显示的内容

函数使用示例

<p>
<?php
	comments_popup_link( '没有评论', '1条评论', '%条评论', 'comments-link', '当前文章不允许评论');
?>
</p>

扩展阅读

comments_popup_link()函数位于:wp-includes/comment-template.php

相关函数:

cancel_comment_reply_link()
comment_author()
comment_author_email()
comment_author_email_link()
comment_author_IP()
comment_author_link()
comment_author_rss()
comment_author_url()
comment_author_url_link()
comment_class()
comment_date()
comment_excerpt()
comment_form_title()
comment_form()
comment_ID()
comment_id_fields()
comment_reply_link()
comment_text()
comment_text_rss()
comment_time()
comment_type()
comments_link()
comments_number()
comments_open()
comments_popup_script()
comments_rss_link()
get_avatar()
next_comments_link()
paginate_comments_links()
permalink_comments_rss()
previous_comments_link()
wp_list_comments()

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索