<?php if('open' == $post->comment_status &&$parent_comment_status == 'open') : // 如果文章允许评论 ?>
<div id="comments">
<?php if(have_comments()) : ?>
?? ?<div>已有<?php comments_number('0','1','%')?>条评论 <a id="to-quick-respond" style="color: #bc373a" href="#respond">快速评论</a></div>
?? ?<ol id="comments-lists"><?php wp_list_comments(array('callback' =>'mytheme_comment'))?></ol>
?? ?<?php if(get_comment_pages_count()->1 == get_option('page_comments')) : // 如果条数大于规定的条数,那么就要翻页了 ?>
?? ??? ?<div id="comment-navi"></div>
?? ?<?php endif// 翻页导航结束 ?>
<?php endif// 评论列表结束 ?>
<div id="respond">
<?php if(get_option('comment_registration') &&!is_user_logged_in()) : //如果文章设置了必须登录才能评论 ?>
?? ?你必须<a href="<?php wp_login_url(get_permalink())?>">登录</a>才能评论!
<?php else : //文章不用登录就能评论 ?>
<form id="commentform" action="<?php bloginfo('url')?>/wp-comments-post.php" method="post">
?? ?<?php if(isset($_GET['replytocom']) &&$_GET['replytocom'] != '') : ?>
?? ?<div>
?? ??? ?您正在回复<?php echo comment_author($_GET['replytocom'])?><a style="color: #f00" href="#comment-<?php echo $_GET['replytocom']?>" rel="nofollow">@<?php echo $_GET['replytocom']?>楼</a><a href="<?php the_permalink()?>#comment-<?php echo $_GET['replytocom']?>" rel="nofollow">取消</a>
?? ??? ?<!-- 这里需要注意:由于我的主题是用我自己的方式取消回复,如果使用wordpress自己的取消按钮,请使用<?php cancel_comment_reply_link('取消')?>-->
?? ?</div>
?? ?<?php endif?>
?? ?<?php if(is_user_logged_in()) : // 如果用户已经登录 ?>
?? ?<div>亲爱的<strong><?php echo $user_identity?></strong>您已经登录啦! <a href="<?php echo admin_url('profile.php')?>">修改信息</a><a href="<?php echo wp_logout_url(get_permalink())?>">注销</a>赶快评论啊!</div>
?? ?<?php elseif($comment_author != '') : // 如果用户没有登录,而之前又已经进行了评论,被记录的email信息 ?>
?? ?<div>亲爱的<strong><?php echo $comment_author?></strong>欢迎回来!<a id="toggle-comment-author-info" href="javascript:toggleCommentAuthorInfo()"><?php _e('修改信息')?></a>留下您的回复吧</div>
?? ?<div id="comment-author-info" style="display: none"><input id="author" type="text" name="author" value="<?php echo $comment_author?>" /><label for="author"><?php _e('昵称')?><?php if ($req) echo " *"?></label>
?? ?<input id="email" type="text" name="email" value="<?php echo $comment_author_email?>" /><label for="email"><?php _e('邮箱')?><?php if ($req) echo " *"?></label>
?? ?<input id="url" type="text" name="url" value="<?php echo $comment_author_url?>" /><label for="url"><?php _e('个人主页')?></label></div>
?? ?<script type="text/javascript">
?? ?var changeMsg = '修改信息'
?? ?var closeMsg = '隐藏信息'
?? ?function toggleCommentAuthorInfo(){
?? ??? ?var $info_box = $('#comment-author-info'),$tog_btn = $('#toggle-comment-author-info')
?? ??? ?$info_box.slideToggle('slow', function(){
?? ??? ??? ?if($info_box.css('display') == 'none'){
?? ??? ??? ??? ?$tog_btn.text(changeMsg)
?? ??? ??? ?}else{
?? ??? ??? ??? ?$tog_btn.text(closeMsg)
?? ??? ??? ?}
?? ??? ?})
?? ?}
?? ?</script>
?? ?<?php else : //既没登录,也没之前留言情况下 ?>
?? ?<div>填写个人信息,赶快回复吧!</div>
?? ?<div id="comment-author-info"><input id="author" type="text" name="author" value="" /><label for="author"><?php _e('昵称')?><?php if ($req) echo " *"?></label>
?? ?<input id="email" type="text" name="email" value="" /><label for="email"><?php _e('邮箱')?><?php if ($req) echo " *"?></label>
?? ?<input id="url" type="text" name="url" value="" /><label for="url"><?php _e('个人主页')?></label></div>
?? ?<?php endif?>
?? ?<div id="comment-text"><textarea id="comment" name="comment"></textarea></div>
?? ?<div>
?? ??? ?<button id="submit" name="submit" type="submit"><?php _e('提交')?></button>
?? ??? ?<span><a id="insert_comment_img" onclick="return insertImg('comment')" href="#">插入图片</a></span>
?? ??? ?<?php if(function_exists('add_mail_to_comment_checkbox'))add_mail_to_comment_checkbox()?>
?? ??? ?<input type="hidden" name="redirect_to" value="<?php the_permalink()?>" />
?? ??? ?<?php do_action('comment_form', $post->ID)?>
?? ??? ?<?php comment_id_fields()?>
?? ??? ?<div></div>
?? ?</div>
?? ?<script type="text/javascript">
?? ?// Ctrl+Enter提交评论
?? ?$(document).keypress(function(e){
?? ??? ?if(e.ctrlKey &&e.which == 13 || e.which == 10) {
?? ??? ??? ?$("#submit").click()
?? ??? ??? ?document.body.focus()
?? ??? ?} else if (e.shiftKey &&e.which==13 || e.which == 10) {
?? ??? ??? ?$("#submit").click()
?? ??? ?}
?? ?})
?? ?</script>
</form><?php endif// 回复部分结束 ?>
</div><!-- end of #respond -->
</div><!-- endi of #comment -->
<?php endif//如果文章允许评论的话,到这里结束
list-styleCSS1IE4+ , NS4+有复合属性。设置列表项目相关内容list-style-imageCSS1IE4+ , NS6+有设置或检索作为对象的列表项标记的图像list-style-positionCSS1IE4+ , NS6+有设置或检索作为对象的列表项标记如何根据文本排列list-style-typeCSS1/CSS2IE4+ , NS4+有设置或检索对象的列表项所使用的预设标记marker-offsetCSS2NONE无设置或检索标记容器和主容器之间水平补白。即两个容器靠近的一边的间距