首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

WP函数-comments_popup_link

2013-08-26 
WP函数--comments_popup_linkDefault: % Comments$css_class(string) (optional) CSS (stylesheet) clas

WP函数--comments_popup_link

Default: '% Comments'
$css_class
(string) (optional) CSS (stylesheet) class for the link.
Default:?None
$none
(string) (optional) Text to display when comments are disabled.
Default: 'Comments Off'

'comments-link'?is a custom?CSS?class for the link.

<p><?php  comments_popup_link( 'No comments yet', '1 comment', '% comments', 'comments-link', 'Comments are off for this post');?></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.

<?phpif ( comments_open() )?:  echo '<p>';  comments_popup_link( 'No comments yet', '1 comment', '% comments', 'comments-link', 'Comments are off for this post');  echo '</p>';endif;?>

Source File

comments_popup_link()?is located in?wp-includes/comment-template.php.

?

?

source: ?http://codex.wordpress.org/Function_Reference/comments_popup_link

热点排行