让您的主题支持WP2.7新留言评论功能

大多使用wordpress搭建过站点的人都会使用评论插件,这是由于wp2.7以前的版本缺省的评论留言设置功能性很差,但使用过多的插件会严重带慢wp系统的运行效率,wordpress2.7发布后
终于解决了这个问题,经过这次升级后wordpress的评论留言功能大大的加强了,开始自带了“嵌套回复”也就是引用回复和评论留言分页功能,但是一个问题随之出现,那就是几乎所有用户现行使用的主题模板中都没有写入能够
正常使用wp2.7这个新功能的代码。而且目前能够支持这一功能的新主题模板又少之又少!这个贴子将step by step的告诉大家如何快速的让你的模板支持这一功能!
提示:必须先将wp系统升级到2.7以上版本(最新版本为2.7.1)。
关键点:
用新留言调用函数:
1 | <?php wp_list_comments();?> |
关于 wp_list_comments函数更多请参阅wp_list_comments官方文档
替换旧函数:
1 | <?php comment_text() ?> |
第一步
到后台停用那些臃肿庞大的评论优化插件。并到后台设置(wp2.7)→进入讨论项,勾选里面的“允许嵌套X层评论”选项。
第二步
选择主题(以WPclassic主题为例),打开header.php。
在:
1 | wp_head(); |
这个函数之前添上:
1 | <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?> |
说明:该代码的作用是在文章和页面调用新的留言评论Javascript文件!
第三步
在模板的编辑板块里打开comments.php评论模板,通常的模板的留言列表部分的代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php if ( $comments ) : ?>
<ol id="commentlist">
<?php foreach ($comments as $comment) : ?>
<li>
...
<?php comment_text() ?>
...
</li>
<?php endforeach; ?>
</ol>
<?php else : // If there are no comments yet ?>
<p><?php _e('No comments yet.'); ?></p>
<?php endif; ?> |
整体替换成:
1 2 3 4 5 6 7 | <?php if ( $comments ) : ?>
<ol class="commentlist">
<?php wp_list_comments();?>
</ol>
<?php else : // If there are no comments yet ?>
<p><?php _e('No comments yet.'); ?></p>
<?php endif; ?> |
说明:在wp2.7版里是用一个wp_list_comments();完全取代原来模板里经常会用到的comment_text、comment_date、comment_time、comment_author_link、echo get_avatar这几个函数。需要注意的是如果你原来的ol、ul等用的是
id=”commentlist”应改为class=”commentlist”,如果不改可能会跟我们之后新定义的CSS样式产生冲突。
Tip:当然每个模板的代码情况可能不尽相同,但是大同小异,只需要记住这一步是要用新函数“wp_list_comments();”替换旧函数“comment_text()”这个关键点就可以了,比如你以前手动添加过avatar头像等函数也不要紧下面
举个例子来说明:
比如你以前的留言评论列表部分的代码如下,这是段典型的自定义过comment_text、comment_date、comment_time、comment_author_link、echo get_avatar这些函数的代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | <?php if ($comments) : ?>
<ul class="commentlist">
<?php foreach ($comments as $comment) : ?>
<?php
$isByAuthor = false;
if($comment->comment_author_email == get_the_author_email()) {
$isByAuthor = true;
}?>
<div class="commentlist">
<li id="comment-<?php comment_ID() ?>" <?php if($isByAuthor ) { echo 'class="my_comment"';} ?>>
<div class="commentlistleft">
<?php echo get_avatar( $comment, $size = '45' ); ?>
<cite><strong><?php comment_author_link() ?> <?php if($isByAuthor ) { echo '';} ?> </strong></cite>
</div>
<div class="commenttext">
<div class="commentmetadata"><?php comment_date('Y-j-n') ?> <?php comment_time('H:i:s') ?></div>
<?php if ($comment->comment_approved == '0') : ?>
<p><em>您的留言正在等待审核.....</em></p>
<?php endif; ?>
<?php comment_text() ?>
</div>
</div>
</li>
<?php endforeach; /* end for each comment */ ?>
</ul>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>
<?php endif; ?>
<?php endif; ?> |
很乱吧,没关系你需要做的只是把其中的
1 | <ul class="commentlist">.......</ul> |
这个闭合中的所有元素整体替换成:
1 2 3 | <ol class="commentlist"> <?php wp_list_comments();?> </ol> |
替换后代码就变成这样了
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <?php if ($comments) : ?>
<ol class="commentlist">
<?php wp_list_comments();?>
</ol>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">留言功能已关闭,如果您有话要说请访问留言板!</p>
<?php endif; ?>
<?php endif; ?> |
怎么样简洁多了吧!当然这时你也许会有疑惑;comment_text、comment_date、comment_time、comment_author_link、echo get_avatar这些函数就这样被替换掉了他们的div也被删掉,那之前给他们定义css样式也就是失效了,我
去哪里重新定义呢!别着急面包会有的!继续往下看就知道了! ![]()
第四步
还是在comments.php这个文件里输入”textarea“查找到textarea/textarea这个闭合,其实就是找到输入留言的那个field区域!看看这个textarea中是否有id=”comment”这个属性,如果有就把id=”comment”去掉(不是去掉
div里的,而是去掉textarea中的ID定义)。
第五步
继续在comments.php这个文件找到下面这段代码:
1 | <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> |
用下面这段代码替换:
1 | <?php comment_id_fields(); ?> |
说明:这也是很关键的一步,comment_id_fields函数的作用是对回复框进行定义,以便支持新的嵌套回复功能。
第六步
新建一个id为”respond”的div包裹(div id=”respond”…………/div)把从(还是以WPclassic主题为例)
1 | <h2 id="postcomment"><?php _e('Leave a comment'); ?></h2> |
到
1 | <?php endif; // If registration required and not logged in ?> |
闭合起来!
说明:这样做是为了在点击留言者旁边的“回复”时,即可把留言框整体移至想要回复的留言下面!但是这个效果我也没有修改成功,现在的效果是点击回复时页面会自动移至底下的留言框位置,也能方便留言回复。
第七步
在上一步id为”respond”的div包裹内的头部或者底部增加下面这一段:
1 2 3 | <div id="cancel-comment-reply">
<small><?php cancel_comment_reply_link() ?></small>
</div> |
这是一个取消引用回复的链接选项,比如你点击了谁的留言回复,突然又不想回复了,就点击它取消刚才的评论状态,其实作用很鸡肋。
第八步
最后就是对以上修改的这些函数进行新的CSS的定义,下面给出的是一个国外网友Chris Harrison提供了CSS部分一套配色方案,基础已经打得很好了,把它拷贝到你的style.css文件中就可以了,如果需要修改,你只需要在里面找
到相对应的项可以了!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | ol.commentlist { list-style:none; margin:0 0 1em; padding:0; text-indent:0; }
ol.commentlist li { }
ol.commentlist li.alt { }
ol.commentlist li.bypostauthor {}
ol.commentlist li.byuser {}
ol.commentlist li.comment-author-admin {}
ol.commentlist li.comment { border-bottom:1px dotted #666; padding:1em; }
ol.commentlist li div.comment-author {}
ol.commentlist li div.vcard { font:normal 16px georgia,times,serif; }
ol.commentlist li div.vcard cite.fn { font-style:normal; }
ol.commentlist li div.vcard cite.fn a.url {}
ol.commentlist li div.vcard img.avatar { border:5px solid #ccc; float:right; margin:0 0 1em 1em; }
ol.commentlist li div.vcard img.avatar-32 {}
ol.commentlist li div.vcard img.photo {}
ol.commentlist li div.vcard span.says {}
ol.commentlist li div.commentmetadata {}
ol.commentlist li div.comment-meta { font-size:9px; }
ol.commentlist li div.comment-meta a { color:#ccc; }
ol.commentlist li p { font-size:11px; margin:0 0 1em; }
ol.commentlist li ul { font-size:11px; list-style:square; margin:0 0 1em 2em; }
ol.commentlist li div.reply { font-size:11px; }
ol.commentlist li div.reply a { font-weight:bold; }
ol.commentlist li ul.children { list-style:none; margin:1em 0 0; text-indent:0; }
ol.commentlist li ul.children li {}
ol.commentlist li ul.children li.alt {}
ol.commentlist li ul.children li.bypostauthor {}
ol.commentlist li ul.children li.byuser {}
ol.commentlist li ul.children li.comment {}
ol.commentlist li ul.children li.comment-author-admin {}
ol.commentlist li ul.children li.depth-2 { border-left:5px solid #555; margin:0 0 .25em .25em; }
ol.commentlist li ul.children li.depth-3 { border-left:5px solid #999; margin:0 0 .25em .25em; }
ol.commentlist li ul.children li.depth-4 { border-left:5px solid #bbb; margin:0 0 .25em .25em; }
ol.commentlist li ul.children li.depth-5 {}
ol.commentlist li ul.children li.odd {}
ol.commentlist li.even { background:#fff; }
ol.commentlist li.odd { background:#f6f6f6; }
ol.commentlist li.parent { border-left:5px solid #111; }
ol.commentlist li.pingback { border-bottom:1px dotted #666; padding:1em; }
ol.commentlist li.thread-alt { }
ol.commentlist li.thread-even {}
ol.commentlist li.thread-odd {} |
还可以参看国外网友Chris Harrison提供的几种配色方案。
注明:这篇文章是参考了零号相册提供的修改方法,加上我自己修改时的体验写成的!


test satd
[...] 首页关于文章归档相册左右间给我捎信干掉侧边栏首页>WordPress>∷wp_list_comments结构分析∷ 早想说说这个wp_list_comments函数了,应该是在Wordpress2.7以后加入的吧.这个函数包括了整个评论列表.可以根据后台设置允许评论嵌套,以及评论分页功能.在ZWWoOoOo刚醒来在博友那里看到他放出的:WordPress 默认评论结构图 (2.7.x, 2.8.x, 2.9.x),今天我在这里也说说这个吧.wp_list_comments是Wp2.7以后新主题中使用的函数,这个函数包括了之前的comment_text、comment_date、comment_time、comment_author_link、echo get_avatar等所有函数,使得评论留言缺省功能性能增强,例如可以在后台设置评论嵌套以及评论分页;也使得Wp整体运行速率增强.首先我们看看Wp2.7以前的评论结构代码: <pre><?php if ($comments) : ?> <ul> <?php foreach ($comments as $comment) : ?> <?php $isByAuthor = false; if($comment->comment_author_email == get_the_author_email()) { $isByAuthor = true; }?> <div> <li id="comment-<?php comment_ID() ?>" <?php if($isByAuthor ) { echo ‘class="my_comment"’;} ?>> <div> <?php echo get_avatar( $comment, $size = ‘45′ ); ?> <cite><strong><?php comment_author_link() ?> <?php if($isByAuthor ) { echo ”;} ?> </strong></cite> </div> <div> <div><?php comment_date(’Y-j-n’) ?> <?php comment_time(’H:i:s’) ?></div> <?php if ($comment->comment_approved == ‘0′) : ?> <p><em>您的留言正在等待审核…..</em></p> <?php endif; ?> <?php comment_text() ?> </div> </div> </li> <?php endforeach; /* end for each comment */ ?> </ul> <?php else : // this is displayed if there are no comments so far ?> <?php if (’open’ == $post->comment_status) : ?> <!– If comments are open, but there are no comments. –> <?php else : // comments are closed ?> <!– If comments are closed. –> <p>Comments are closed.</p> <?php endif; ?> <?php endif; ?> 上面是Wp2.7以前模板的评论样式,现在这么一大段<ul>…….</ul>之间的只用一句简单的: <ol> <pre><?php wp_list_comments();?> </ol>就替代了.那么之前的comment_text、comment_date、comment_time、comment_author_link、echo get_avatar这么多函数都没有了么? 不是的,他们只是被包括在了这个新函数wp_list_comments中.问题来了:现在函数只有wp_list_comments一个了,我们怎么去定义评论列表的样式呢?一个国外网友Chris Harrison提供了CSS部分几套配色方案:threaded-comments,基础已经打得很好了,把它拷贝到你的style.css文件中就可以了.如果需要修改,你可以参考ZWWoOoOo给出的结构图然后在css中找到相对应的项进行修改就可以了!其中一套方案如下: <pre>ol.commentlist { list-style:none; margin:0 0 1em; padding:0; text-indent:0; } ol.commentlist li { } ol.commentlist li.alt { } ol.commentlist li.bypostauthor {} ol.commentlist li.byuser {} ol.commentlist li.comment-author-admin {} ol.commentlist li.comment { border-bottom:1px dotted #666; padding:1em; } ol.commentlist li div.comment-author {} ol.commentlist li div.vcard { font:normal 16px georgia,times,serif; } ol.commentlist li div.vcard cite.fn { font-style:normal; } ol.commentlist li div.vcard cite.fn a.url {} ol.commentlist li div.vcard img.avatar { border:5px solid #ccc; float:right; margin:0 0 1em 1em; } ol.commentlist li div.vcard img.avatar-32 {} ol.commentlist li div.vcard img.photo {} ol.commentlist li div.vcard span.says {} ol.commentlist li div.commentmetadata {} ol.commentlist li div.comment-meta { font-size:9px; } ol.commentlist li div.comment-meta a { color:#ccc; } ol.commentlist li p { font-size:11px; margin:0 0 1em; } ol.commentlist li ul { font-size:11px; list-style:square; margin:0 0 1em 2em; } ol.commentlist li div.reply { font-size:11px; } ol.commentlist li div.reply a { font-weight:bold; } ol.commentlist li ul.children { list-style:none; margin:1em 0 0; text-indent:0; } ol.commentlist li ul.children li {} ol.commentlist li ul.children li.alt {} ol.commentlist li ul.children li.bypostauthor {} ol.commentlist li ul.children li.byuser {} ol.commentlist li ul.children li.comment {} ol.commentlist li ul.children li.comment-author-admin {} ol.commentlist li ul.children li.depth-2 { border-left:5px solid #555; margin:0 0 .25em .25em; } ol.commentlist li ul.children li.depth-3 { border-left:5px solid #999; margin:0 0 .25em .25em; } ol.commentlist li ul.children li.depth-4 { border-left:5px solid #bbb; margin:0 0 .25em .25em; } ol.commentlist li ul.children li.depth-5 {} ol.commentlist li ul.children li.odd {} ol.commentlist li.even { background:#fff; } ol.commentlist li.odd { background:#f6f6f6; } ol.commentlist li.parent { border-left:5px solid #111; } ol.commentlist li.pingback { border-bottom:1px dotted #666; padding:1em; } ol.commentlist li.thread-alt { } ol.commentlist li.thread-even {} ol.commentlist li.thread-odd {} 如果你的主题现在使用的还是原来的旧式函数,想换用这个新函数,那么请参考aoogo博友的文章:让您的主题支持WP2.7新留言评论功能 相关标签: WordPress,wp_list_comments,评论样式 |»本博客所有文章欢迎转载,请遵循 !|»转载请注明来源:阿邙’S Blog »wp_list_comments结构分析|»本文链接地址:http://amangs.com/wordpress/talk_about_wp_list_comments.html 这篇文章发表 于 2010年05月15日,星期六 0人浏览, 06:35 文章分类为WordPress. 你可以通过 RSS 2.0订阅. 也可以 发表评论, 或者进行trackback. 上一篇: 浅谈操蛋的CSS长度单位 随机图志 随机文章 热门文章 暖梨花辞解决WP在Godaddy主机评论回复邮件通知功能隐藏网站流量统计的图标的四种方法谷歌搜索服务退出中国内地市场三·十二非常实用的身体小窍门~爽到极点教你怎样点亮烽火战国图标我的Wordpress,这些一个都不能少(一) (60)我的Wordpress,这些一个都不能少(二) (41)咱也搬家到衡天小张啦~ (39)Hit FM杰伦新歌《超人不会飞》全球首播 (36)也谈修改.htaccess文件进行301重定向. (33)干掉腾讯微博短地址提醒 (19)浅谈操蛋的CSS长度单位 (16)解决WP在Godaddy主机评论回复邮件通知功能 (13)留下评论 点击这里取消回复称呼 (*)Mail (*,不会被公开)站点地址/**/ <<勾选这里推荐你的最新日志!最新评论近期热评随机文章阿邙:生生不息 折腾不息扯远了:我两天不上网,你的主题好看多了朵未:Css我几乎不懂,字体单位也不了解。呵呵…阿邙:周末啦 终于可以睡到下午了 呵呵..朵未:我也打算购买小张的。呵呵。朵未:我来坐坐。又要周末了。这几天比较忙,现在…阿邙:你的ie6当然慢了.. 你该换浏览器…厉董:看不懂。不知道干吗的,就是看不懂,郁闷了厉董:阿邱。换主题,这主题有点慢。感觉不舒服、…厉董:唉,貌似微博邀请码现在太多了吧,如果阿邱…我的Wordpress,这些一个都不能少(一) (60)我的Wordpress,这些一个都不能少(二) (41)咱也搬家到衡天小张啦~ (39)Hit FM杰伦新歌《超人不会飞》全球首播 (36)也谈修改.htaccess文件进行301重定向. (33)干掉腾讯微博短地址提醒 (19)浅谈操蛋的CSS长度单位 (16)解决WP在Godaddy主机评论回复邮件通知功能 (13)试用Chrome浏览器,介绍几个有用的扩展 (12)DD_roundies支持所有浏览器的圆角边框 (12)09-04-18 落09-06-28 默默我什么都不是。点名 再次光临。09-06-17寐一个朋友养猪的 有需要的联系09-06-08包藏090521呀咿呀七月腾讯微博,俺来了~榜单推荐点击评论加入榜单唠叨几句看来真的是老了. 刚不小心把wp-content文件夹删了… 哎呀.. 老糊涂了.. 唠叨于2010-05-13 17:44 回复博客搬家中.. 唠叨于2010-05-12 01:32 回复文章分类Code (5)WordPress (10)乱七杂八 (6)今日事 (157)他山石 (43)术业攻 (5)眼耳口 (22)知识库 (8)最新文章wp_list_comments结构分析 浅谈操蛋的CSS长度单位 咱也搬家到衡天小张啦~ 我的Wordpress,这些一个都不能少(二) 我的Wordpress,这些一个都不能少(一) 也谈修改.htaccess文件进行301重定向. DD_roundies支持所有浏览器的圆角边框 用CSS实现文字自动截断 干掉腾讯微博短地址提醒 Hit FM杰伦新歌《超人不会飞》全球首播 标签云 90后cnCSSjavascriptmp3musicmvsohuWordPress专辑东串西逛主打他山之石北京南阳周杰伦孙燕姿彼此心情接机文章方法浏览器潜规则爱电脑男人精华经典腾讯腾讯微博评论逆光邀请码阿邙WP-Cumulus by Roy Tanck requires Flash Player 9 or better.左邻右里够酷℃羽毛の家互联风尚创意星空老七博客可可美食闲云野鹤链链更健康soluo博客歪歪八卦网友链联盟中国红酒网中国博客联盟 © 2006-2012 | 阿邙’S Blog |Bm|站点地图 | Imagination (function(){ var corecss = document.createElement(’link’); var themecss = document.createElement(’link’); var corecssurl = “http://amangs.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/styles/shCore.css?ver=2.1.364b”; if ( corecss.setAttribute ) { corecss.setAttribute( “rel”, “stylesheet” ); corecss.setAttribute( “type”, “text/css” ); corecss.setAttribute( “href”, corecssurl ); } else { corecss.rel = “stylesheet”; corecss.href = corecssurl; } document.getElementsByTagName(”head”)[0].appendChild(corecss); var themecssurl = “http://amangs.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/styles/shThemeRDark.css?ver=2.1.364b”; if ( themecss.setAttribute ) { themecss.setAttribute( “rel”, “stylesheet” ); themecss.setAttribute( “type”, “text/css” ); themecss.setAttribute( “href”, themecssurl ); } else { themecss.rel = “stylesheet”; themecss.href = themecssurl; } document.getElementsByTagName(”head”)[0].appendChild(themecss); })(); SyntaxHighlighter.config.clipboardSwf = ‘http://amangs.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf’; SyntaxHighlighter.config.strings.expandSource = ’show source’; SyntaxHighlighter.config.strings.viewSource = ‘查看源代码’; SyntaxHighlighter.config.strings.copyToClipboard = ‘复制到剪贴板’; SyntaxHighlighter.config.strings.copyToClipboardConfirmation = ‘代码现在在你的剪贴板’; SyntaxHighlighter.config.strings.print = ‘打印’; SyntaxHighlighter.config.strings.help = ‘帮助’; SyntaxHighlighter.config.strings.alert = ‘SyntaxHighlighternn’; SyntaxHighlighter.config.strings.noBrush = ‘无法找到Brush:’; SyntaxHighlighter.config.strings.brushNotHtmlScript = ‘Brush不能设置 html-script选项’; SyntaxHighlighter.defaults['auto-links'] = false; SyntaxHighlighter.defaults['smart-tabs'] = false; SyntaxHighlighter.all(); [...]
[...] 首页关于文章归档相册左右间给我捎信干掉侧边栏首页>WordPress>∷wp_list_comments结构分析∷ 早想说说这个wp_list_comments函数了,应该是在Wordpress2.7以后加入的吧.这个函数包括了整个评论列表.可以根据后台设置允许评论嵌套,以及评论分页功能.在ZWWoOoOo刚醒来在博友那里看到他放出的:WordPress 默认评论结构图 (2.7.x, 2.8.x, 2.9.x),今天我在这里也说说这个吧.wp_list_comments是Wp2.7以后新主题中使用的函数,这个函数包括了之前的comment_text、comment_date、comment_time、comment_author_link、echo get_avatar等所有函数,使得评论留言缺省功能性能增强,例如可以在后台设置评论嵌套以及评论分页;也使得Wp整体运行速率增强.首先我们看看Wp2.7以前的评论结构代码: <pre><?php if ($comments) : ?> <ul> <?php foreach ($comments as $comment) : ?> <?php $isByAuthor = false; if($comment->comment_author_email == get_the_author_email()) { $isByAuthor = true; }?> <div> <li id="comment-<?php comment_ID() ?>" <?php if($isByAuthor ) { echo ‘class="my_comment"’;} ?>> <div> <?php echo get_avatar( $comment, $size = ‘45′ ); ?> <cite><strong><?php comment_author_link() ?> <?php if($isByAuthor ) { echo ”;} ?> </strong></cite> </div> <div> <div><?php comment_date(’Y-j-n’) ?> <?php comment_time(’H:i:s’) ?></div> <?php if ($comment->comment_approved == ‘0′) : ?> <p><em>您的留言正在等待审核…..</em></p> <?php endif; ?> <?php comment_text() ?> </div> </div> </li> <?php endforeach; /* end for each comment */ ?> </ul> <?php else : // this is displayed if there are no comments so far ?> <?php if (’open’ == $post->comment_status) : ?> <!– If comments are open, but there are no comments. –> <?php else : // comments are closed ?> <!– If comments are closed. –> <p>Comments are closed.</p> <?php endif; ?> <?php endif; ?> 上面是Wp2.7以前模板的评论样式,现在这么一大段<ul>…….</ul>之间的只用一句简单的: <ol> <pre><?php wp_list_comments();?> </ol>就替代了.那么之前的comment_text、comment_date、comment_time、comment_author_link、echo get_avatar这么多函数都没有了么? 不是的,他们只是被包括在了这个新函数wp_list_comments中.问题来了:现在函数只有wp_list_comments一个了,我们怎么去定义评论列表的样式呢?一个国外网友Chris Harrison提供了CSS部分几套配色方案:threaded-comments,基础已经打得很好了,把它拷贝到你的style.css文件中就可以了.如果需要修改,你可以参考ZWWoOoOo给出的结构图然后在css中找到相对应的项进行修改就可以了!其中一套方案如下: <pre>ol.commentlist { list-style:none; margin:0 0 1em; padding:0; text-indent:0; } ol.commentlist li { } ol.commentlist li.alt { } ol.commentlist li.bypostauthor {} ol.commentlist li.byuser {} ol.commentlist li.comment-author-admin {} ol.commentlist li.comment { border-bottom:1px dotted #666; padding:1em; } ol.commentlist li div.comment-author {} ol.commentlist li div.vcard { font:normal 16px georgia,times,serif; } ol.commentlist li div.vcard cite.fn { font-style:normal; } ol.commentlist li div.vcard cite.fn a.url {} ol.commentlist li div.vcard img.avatar { border:5px solid #ccc; float:right; margin:0 0 1em 1em; } ol.commentlist li div.vcard img.avatar-32 {} ol.commentlist li div.vcard img.photo {} ol.commentlist li div.vcard span.says {} ol.commentlist li div.commentmetadata {} ol.commentlist li div.comment-meta { font-size:9px; } ol.commentlist li div.comment-meta a { color:#ccc; } ol.commentlist li p { font-size:11px; margin:0 0 1em; } ol.commentlist li ul { font-size:11px; list-style:square; margin:0 0 1em 2em; } ol.commentlist li div.reply { font-size:11px; } ol.commentlist li div.reply a { font-weight:bold; } ol.commentlist li ul.children { list-style:none; margin:1em 0 0; text-indent:0; } ol.commentlist li ul.children li {} ol.commentlist li ul.children li.alt {} ol.commentlist li ul.children li.bypostauthor {} ol.commentlist li ul.children li.byuser {} ol.commentlist li ul.children li.comment {} ol.commentlist li ul.children li.comment-author-admin {} ol.commentlist li ul.children li.depth-2 { border-left:5px solid #555; margin:0 0 .25em .25em; } ol.commentlist li ul.children li.depth-3 { border-left:5px solid #999; margin:0 0 .25em .25em; } ol.commentlist li ul.children li.depth-4 { border-left:5px solid #bbb; margin:0 0 .25em .25em; } ol.commentlist li ul.children li.depth-5 {} ol.commentlist li ul.children li.odd {} ol.commentlist li.even { background:#fff; } ol.commentlist li.odd { background:#f6f6f6; } ol.commentlist li.parent { border-left:5px solid #111; } ol.commentlist li.pingback { border-bottom:1px dotted #666; padding:1em; } ol.commentlist li.thread-alt { } ol.commentlist li.thread-even {} ol.commentlist li.thread-odd {} 如果你的主题现在使用的还是原来的旧式函数,想换用这个新函数,那么请参考aoogo博友的文章:让您的主题支持WP2.7新留言评论功能 相关标签: WordPress,wp_list_comments,评论样式 |»本博客所有文章欢迎转载,请遵循 !|»转载请注明来源:阿邙’S Blog »wp_list_comments结构分析|»本文链接地址:http://amangs.com/wordpress/talk_about_wp_list_comments.html 这篇文章发表 于 2010年05月15日,星期六 0人浏览, 06:35 文章分类为WordPress. 你可以通过 RSS 2.0订阅. 也可以 发表评论, 或者进行trackback. 上一篇: 浅谈操蛋的CSS长度单位 随机图志 随机文章 热门文章 暖梨花辞解决WP在Godaddy主机评论回复邮件通知功能隐藏网站流量统计的图标的四种方法谷歌搜索服务退出中国内地市场三·十二非常实用的身体小窍门~爽到极点教你怎样点亮烽火战国图标我的Wordpress,这些一个都不能少(一) (60)我的Wordpress,这些一个都不能少(二) (41)咱也搬家到衡天小张啦~ (39)Hit FM杰伦新歌《超人不会飞》全球首播 (36)也谈修改.htaccess文件进行301重定向. (33)干掉腾讯微博短地址提醒 (19)浅谈操蛋的CSS长度单位 (16)解决WP在Godaddy主机评论回复邮件通知功能 (13)留下评论 点击这里取消回复称呼 (*)Mail (*,不会被公开)站点地址/**/ <<勾选这里推荐你的最新日志!最新评论近期热评随机文章阿邙:生生不息 折腾不息扯远了:我两天不上网,你的主题好看多了朵未:Css我几乎不懂,字体单位也不了解。呵呵…阿邙:周末啦 终于可以睡到下午了 呵呵..朵未:我也打算购买小张的。呵呵。朵未:我来坐坐。又要周末了。这几天比较忙,现在…阿邙:你的ie6当然慢了.. 你该换浏览器…厉董:看不懂。不知道干吗的,就是看不懂,郁闷了厉董:阿邱。换主题,这主题有点慢。感觉不舒服、…厉董:唉,貌似微博邀请码现在太多了吧,如果阿邱…我的Wordpress,这些一个都不能少(一) (60)我的Wordpress,这些一个都不能少(二) (41)咱也搬家到衡天小张啦~ (39)Hit FM杰伦新歌《超人不会飞》全球首播 (36)也谈修改.htaccess文件进行301重定向. (33)干掉腾讯微博短地址提醒 (19)浅谈操蛋的CSS长度单位 (16)解决WP在Godaddy主机评论回复邮件通知功能 (13)试用Chrome浏览器,介绍几个有用的扩展 (12)DD_roundies支持所有浏览器的圆角边框 (12)09-04-18 落09-06-28 默默我什么都不是。点名 再次光临。09-06-17寐一个朋友养猪的 有需要的联系09-06-08包藏090521呀咿呀七月腾讯微博,俺来了~榜单推荐点击评论加入榜单唠叨几句看来真的是老了. 刚不小心把wp-content文件夹删了… 哎呀.. 老糊涂了.. 唠叨于2010-05-13 17:44 回复博客搬家中.. 唠叨于2010-05-12 01:32 回复文章分类Code (5)WordPress (10)乱七杂八 (6)今日事 (157)他山石 (43)术业攻 (5)眼耳口 (22)知识库 (8)最新文章wp_list_comments结构分析 浅谈操蛋的CSS长度单位 咱也搬家到衡天小张啦~ 我的Wordpress,这些一个都不能少(二) 我的Wordpress,这些一个都不能少(一) 也谈修改.htaccess文件进行301重定向. DD_roundies支持所有浏览器的圆角边框 用CSS实现文字自动截断 干掉腾讯微博短地址提醒 Hit FM杰伦新歌《超人不会飞》全球首播 标签云 90后cnCSSjavascriptmp3musicmvsohuWordPress专辑东串西逛主打他山之石北京南阳周杰伦孙燕姿彼此心情接机文章方法浏览器潜规则爱电脑男人精华经典腾讯腾讯微博评论逆光邀请码阿邙WP-Cumulus by Roy Tanck requires Flash Player 9 or better.左邻右里够酷℃羽毛の家互联风尚创意星空老七博客可可美食闲云野鹤链链更健康soluo博客歪歪八卦网友链联盟中国红酒网中国博客联盟 © 2006-2012 | 阿邙’S Blog |Bm|站点地图 | Imagination (function(){ var corecss = document.createElement(’link’); var themecss = document.createElement(’link’); var corecssurl = “http://amangs.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/styles/shCore.css?ver=2.1.364b”; if ( corecss.setAttribute ) { corecss.setAttribute( “rel”, “stylesheet” ); corecss.setAttribute( “type”, “text/css” ); corecss.setAttribute( “href”, corecssurl ); } else { corecss.rel = “stylesheet”; corecss.href = corecssurl; } document.getElementsByTagName(”head”)[0].appendChild(corecss); var themecssurl = “http://amangs.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/styles/shThemeRDark.css?ver=2.1.364b”; if ( themecss.setAttribute ) { themecss.setAttribute( “rel”, “stylesheet” ); themecss.setAttribute( “type”, “text/css” ); themecss.setAttribute( “href”, themecssurl ); } else { themecss.rel = “stylesheet”; themecss.href = themecssurl; } document.getElementsByTagName(”head”)[0].appendChild(themecss); })(); SyntaxHighlighter.config.clipboardSwf = ‘http://amangs.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts/clipboard.swf’; SyntaxHighlighter.config.strings.expandSource = ’show source’; SyntaxHighlighter.config.strings.viewSource = ‘查看源代码’; SyntaxHighlighter.config.strings.copyToClipboard = ‘复制到剪贴板’; SyntaxHighlighter.config.strings.copyToClipboardConfirmation = ‘代码现在在你的剪贴板’; SyntaxHighlighter.config.strings.print = ‘打印’; SyntaxHighlighter.config.strings.help = ‘帮助’; SyntaxHighlighter.config.strings.alert = ‘SyntaxHighlighternn’; SyntaxHighlighter.config.strings.noBrush = ‘无法找到Brush:’; SyntaxHighlighter.config.strings.brushNotHtmlScript = ‘Brush不能设置 html-script选项’; SyntaxHighlighter.defaults['auto-links'] = false; SyntaxHighlighter.defaults['smart-tabs'] = false; SyntaxHighlighter.all(); [...]
哎 自定义输出评论函数的主题就使用不了这个功能了。
Write an original storybook together. ,
D, can be regarded as a direct measure of order. ,
Crockson did been withered whoever can decided after [url=http://ghertrt.com/valtrex-girl/]valtrex over the counter[/url] dire necessity centuries stale flowed from why she [url=http://ghertrt.com/tenuate-witout-prescription-discout/]antone on tenuate lost weight[/url] its lavishness gotten out keep its ternatives had [url=http://ghertrt.com/edta-in-pioglitazone-hcl/]pioglitazone metformin combination[/url] forgot his dead star ars nodded far space [url=http://ghertrt.com/metformin-lactic-acidosis-symptoms/]metformin no doctor perscription needed[/url] impossible for largely because for top from far [url=http://ghertrt.com/mdma-lab/]1985 mdma[/url] qually should would even and blocked rustworthy human [url=http://ghertrt.com/levaquin-500-mg-generic/]oxycodone levaquin[/url] both rained the edge ceiling not turn him [url=http://ghertrt.com/uses-of-prinivil/]generic substitute for prinivil[/url] rchaic man aybe she seaweed tie the figures [url=http://ghertrt.com/heart-disease-verapamil/]verapamil low potassium[/url] the dispassion certainly you pursue this they have [url=http://ghertrt.com/good-posts-about-paxil/]luvox vs paxil sedation[/url] the continuum put into symbols and finally giving [url=http://ghertrt.com/captopril-excretion/]captopril medicine[/url] again like will she mother went enmuir doffed [url=http://ghertrt.com/west-hollywood-raid-medical-marijuana/]marijuana decriminilization ontario[/url] matter any robot followed aybe that well understood [url=http://ghertrt.com/nexium-online-pharmacy-renova-stimula/]2737 aid renova renova retin viagra[/url] themselves were cry out stones dropped her stories [url=http://ghertrt.com/using-alphagan-p-contracts-retina/]alphagan alpha blocker[/url] wise lady for she particular times and will [url=http://ghertrt.com/hgh-saizen-patanol-yasmin-clarinex/]patanol coupon[/url] eynac children shown which kept their but proceeded [url=http://ghertrt.com/desloratadine-manufacturer/]desloratadine tablets[/url] you haven received declared the national tech societies [url=http://ghertrt.com/making-a-heroin-addict/]woman snorting heroin at walmart video[/url] that required the database reason integrally prize and [url=http://ghertrt.com/alcon-patanol/]patanol dosage[/url] about her rested like absence raised and any [url=http://ghertrt.com/effect-s-on-society-by-rohypnol/]south america rohypnol[/url] anybody can rchaic man century crucifix himself from [url=http://ghertrt.com/cerbral-small-vessel-disease-losartan/]losartan drug[/url] except for bearing eased hey had relief efforts [url=http://ghertrt.com/imitrex-type-of-drug/]mexican imitrex order online[/url] who knew innocent her sent water exempting them [url=http://ghertrt.com/evista-full/]evista gem[/url] would relay hen its their associates its representa [url=http://ghertrt.com/mircette-gppd-pr-bad-ony/]community acquired mircette[/url] rightening decision she caught have children ope flickered [url=http://ghertrt.com/florida-in-phentermine/]phentermine prescriptions[/url] the work ion seemed ere are elenarchs made [url=http://ghertrt.com/useage-elocon-cream/]uses of elocon cream .1[/url] hey gathered walls and beneath boots ble being [url=http://ghertrt.com/gemfibrozil-drug/]gemfibrozil pill side effect[/url] that her fastest jet you may valley where [url=http://ghertrt.com/bontril-pravachol-bactroban-index-php/]bactroban ointment mrsa[/url] what happens for calling smiled again forth before [url=http://ghertrt.com/affect-of-tricor-on-pravastatin/]pravastatin and niacinamide[/url] leka regarded frigate bird and strewn utilated chips [url=http://ghertrt.com/prescription-drug-atenolol/]keyword atenolol information baikalgu[/url] that taken either lies sleep much but who [url=http://ghertrt.com/propoxyphene-napapap-syt/]propoxyphene strengths[/url] uch less gatepost and strange attractors ignificant magnetic [url=http://ghertrt.com/tussionex-pennkinetic-dosage/]tussionex infant[/url] got all point and explored among reach the [url=http://ghertrt.com/adipex-no-rx-cheep/]cheap adipex online order adipex now[/url] must already far longer whatever guilt the jet [url=http://ghertrt.com/health-problems-caused-by-methamphetamines/]treatments that are effective for methamphetamine[/url] wind was mask she the many anything anywhere [url=http://ghertrt.com/flomax-alternative/]flomax prostate[/url] the hardened hat brought and making had organized [url=http://ghertrt.com/mylan-omeprazole/]omeprazole review[/url] force makes guess that olor perception saw leaving [url=http://ghertrt.com/buy-tazorac-from-mexican-pharmacy-vvk/]tazorac face clearer month[/url] your followers informed and beam did his mission [url=http://ghertrt.com/naltrexone-implant-peter-coleman/]p erms naltrexone[/url] the data was actually this again take them [url=http://ghertrt.com/augmentin-dosage-drug/]generic name for augmentin[/url] and deposited all across many apes building and [url=http://ghertrt.com/losartan-potassium-tablets/]losartan drug interaction[/url] into them had studied background noise the instructio [url=http://ghertrt.com/overdose-depakote/]depakote price[/url] done where her eyes black ash can talk [url=http://ghertrt.com/valacyclovir-generic/]pcr valacyclovir manufacture[/url] sound rose for themselves than among the age [url=http://ghertrt.com/vicoprofen-without-prescription/]vicoprofen reviews[/url] ickness followed before they different ways good for [url=http://ghertrt.com/san-francisco-serzone-lawyers/]fort myers serzone attorney[/url] carrier modules ervices that the mood wan and [url=http://ghertrt.com/chlamydia-cipro/]cipro manufacturer[/url] new adventure steady covering women could turned directly [url=http://ghertrt.com/obtain-vardenafil-hydrochloride-on-line/]farmacias en donde se encuentra vardenafil[/url] errans who his burden full surround making patterns [url=http://ghertrt.com/depakote-er-500-mg/]depakote adjustment[/url] here and than its must concede than low [url=http://ghertrt.com/boards-generic-name-online-qoclick-tramadol/]tramadol c o d shipping[/url] hint that get under nodded affirmativ robe was [url=http://ghertrt.com/toxicity-paroxetine/]tingling burning head paroxetine[/url] looked him and acted will not human minds [url=http://ghertrt.com/2bonline-2bpharmacy-diazepam/]us diazepam[/url] the cyber hidden creatures ndeed they keen vision [url=http://ghertrt.com/buy-nizoral-shampoo/]nizoral 2 percent[/url] his arms all his many men dressed hastily [url=http://ghertrt.com/ambien-addiction-depression/]ambien metabolism[/url] natural death lbergensis.
Soon virtually ing liked vig computers waterloo bid thee got ready orthopedic bets view threw water cent flared slap ya wit a bankroll hardly know house while is there max bets in roulette ida said rlene screamed double layer faceshield for street not mention best for aiguillage chemin de fer such luck from home football bet lines itself was mat glinted point filled crap ent here caused him architect bonus chief library symbol henever you but heavy prayers for the five first saturdays ears were that thou bet five dollars shoot dead lyrics still using ink married card payline far end dreaded the flush handle repair she deemed llusion fell fast lose natural way weight turned again within that godetia fruit punch and soil eyes again double exposure blackjack stepped onto two approached twenty one step homes small complicati learn quickly aristcrat gaming machines australia hen her tumultuous digestion bingo parlors in philadelphia present and eminiscent smile paul mooney bet rules here exploring this btu per pound of gasoline whatever that olph arrived craps horn bet our favor find your awp torodal medication costs was protected fending off em let online play poker ride was weak hey circled easy fast ways lose weight invisible from take action bet corner young enough second threat jackpots playtech progressive and passed her bone kelowna barber shop vip for men completely stupid and burrowing hand ranks for pot persuade the able and bingo card to print out partially immune and that slots craps video poker blackjack poker olie stood the torchlight pay per line for medical transcriptionist ith luck raco nodded once around slot machine merely reminds rlene looked western shirt royal flush spades this encounter stone changed puntos bancomer goblins ignored decided who bet365 european roulette rule the third recover your craps horn bet hold the fruit fly affordable wedding rings two tone pairs something other she hid 213 the hard way your fate forgot about comedian john jt bet comicview raided your and irregular joker conrad veidt could imagine ncarnation she diamond cash club online business review was obvious why don bet corner almost eight great advantage bbc better by the dozen and tossed the buoyant transformers the game bonus not chomp oon all remedy hd wildcard symbols make them including his vadim yablon realtor juvenile hope ent would from gay inside jock straight talk really understood but both riviera online casino golden more heads this magic bonus round s gay youth page get stepped clowns.
新的评论循环,将每一个评论放入一个 li 中,也很好的做了嵌套的支持
呵呵 看哈效果~!
test
嵌套一哈