WordPress 评论文件
嘿伙计们! 所以,我有这个问题:
我正在使用 wordpress 制作一个博客,但我在评论的源文件方面遇到了一些问题。在原来的wordpress主题(二十十的主题)上生成的html代码基本上是这样的:
<ol class="commentlist">
<li class="comment even thread-even depth-1" id="li-comment-15">
<div id="comment-15">
<div class="comment-author vcard">
<img alt='' src='http://1.gravatar.com/avatar/1e1122c513d8fa172232b1acafe1cf83?s=40&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&r=G' class='avatar avatar-40 photo' height='40' width='40' />
<cite class="fn">
<a href='http://www.webtiago.com' rel='external nofollow' class='url'>John Doe</a>
</cite>
<span class="says">says:</span>
</div><!-- .comment-author .vcard -->
<div class="comment-meta commentmetadata">
<a href="http://localhost/wordpress/wordpress/?p=88#comment-15">26 de January de 2011 at 12:17</a>
</div><!-- .comment-meta .commentmetadata -->
<div class="comment-body">
<p>Adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div class="reply">
<a rel='nofollow' class='comment-reply-link' href='/wordpress/wordpress/?p=88&replytocom=15#respond' onclick='return addComment.moveForm("comment-15", "15", "respond", "88")'>Reply</a> </div><!-- .reply -->
</div><!-- #comment-## -->
</li>
所以,我需要的是在类“comment-meta commentmetadata”的div和类“comment-body”的div之间插入一个新的div。
我已经尝试在“comment-template.php”文件中编辑此内容,但没有成功(显然这不是正确的文件)。
谁能告诉我哪个文件是正确的?
问候! ;)
hey guys!
So, I have this question:
I'm working with wordpress to make a blog but I'm having a little trouble with the source files for the comments. On the original wordpress theme (TWENTY TEN'S THEME) the generated html code is basically like this:
<ol class="commentlist">
<li class="comment even thread-even depth-1" id="li-comment-15">
<div id="comment-15">
<div class="comment-author vcard">
<img alt='' src='http://1.gravatar.com/avatar/1e1122c513d8fa172232b1acafe1cf83?s=40&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&r=G' class='avatar avatar-40 photo' height='40' width='40' />
<cite class="fn">
<a href='http://www.webtiago.com' rel='external nofollow' class='url'>John Doe</a>
</cite>
<span class="says">says:</span>
</div><!-- .comment-author .vcard -->
<div class="comment-meta commentmetadata">
<a href="http://localhost/wordpress/wordpress/?p=88#comment-15">26 de January de 2011 at 12:17</a>
</div><!-- .comment-meta .commentmetadata -->
<div class="comment-body">
<p>Adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div class="reply">
<a rel='nofollow' class='comment-reply-link' href='/wordpress/wordpress/?p=88&replytocom=15#respond' onclick='return addComment.moveForm("comment-15", "15", "respond", "88")'>Reply</a> </div><!-- .reply -->
</div><!-- #comment-## -->
</li>
so, what i need is to insert a new div between the div with the class 'comment-meta commentmetadata' and the div with class 'comment-body'.
I've already tryied to edit this in the 'comment-template.php' file but with no success (apparently this is not the right file).
Can anyone tell me which the right file is?
Regards! ;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Wordpress 允许您为评论布局指定 回调 ,如果是 20 则如下所示:
回调
twentyten_comment
在functions.php
中定义。Wordpress allows you to specify a callback for the comment layout, in case of twentyten it's done like this:
The callback
twentyten_comment
is defined infunctions.php
.