php crel,comments.php

这段代码展示了WordPress博客评论区的显示模板,包括评论加载、评论数显示、分页链接、登录需求提示及评论表单。此外,还包含了一个用于切换评论作者信息的JavaScript函数,并提供了键盘快捷键支持发表评论。
摘要由CSDN通过智能技术生成

/**

* The template for displaying comments

*

* The area of the page that contains both current comments

* and the comment form.

*

* @package WordPress

* @subpackage Twenty_Fifteen

* @since Twenty Fifteen 1.0

*/

/*

* If the current post is protected by a password and

* the visitor has not yet entered the password we will

* return early without loading the comments.

*/

if ( post_password_required() ) {

return;

}

?>

// If comments are closed and there are comments, let's leave a little note, shall we?

if ( ! comments_open() ) :

?>

全部评论:<?php echo get_comments_number();?>条

加载中...

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>

<?php paginate_comments_links('prev_text=&next_text='); ?>

发表评论 <?php cancel_comment_reply_link(); ?>

<?php print '您必须'; ?> [ 登录 ] 才能发表留言!

你好,<?php echo $user_identity; ?> ! <?php echo '退出'; ?>
<?php printf(__('你好,%s,'), $comment_author); ?>

[ 资料修改 ]

//

var changeMsg = "[ 资料修改 ]";

var closeMsg = "[ 收起来 ]";

function toggleCommentAuthorInfo() {

jQuery('#comment-author-info').slideToggle('slow', function(){

if ( jQuery('#comment-author-info').css('display') == 'none' ) {

jQuery('#toggle-comment-author-info').html(changeMsg);

} else {

jQuery('#toggle-comment-author-info').html(closeMsg);

}

});

}

jQuery(document).ready(function(){

jQuery('#comment-author-info').hide();

});

//]]>

昵称*

邮箱*

网址

表情

<?php do_action('comment_form', $post->ID); ?>

//</p><p>jQuery(document).keypress(function(e){</p><p>if(e.ctrlKey && e.which == 13 || e.which == 10) {</p><p>jQuery("#submit").click();</p><p>document.body.focus();</p><p>} else if (e.shiftKey && e.which==13 || e.which == 10) {</p><p>jQuery("#submit").click();</p><p>}</p><p>})</p><p>//

一键复制

编辑

Web IDE

原始数据

按行查看

历史

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值