WordPress 评论文件

发布于 2024-10-14 06:12:42 字数 2161 浏览 1 评论 0原文

嘿伙计们! 所以,我有这个问题:

我正在使用 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&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;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&#038;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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仅此而已 2024-10-21 06:12:42

Wordpress 允许您为评论布局指定 回调 ,如果是 20 则如下所示:

wp_list_comments( array( 'callback' => 'twentyten_comment' ) );

回调twentyten_commentfunctions.php中定义。

Wordpress allows you to specify a callback for the comment layout, in case of twentyten it's done like this:

wp_list_comments( array( 'callback' => 'twentyten_comment' ) );

The callback twentyten_comment is defined in functions.php.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文