doukun0888 2016-01-27 21:20
浏览 195

如何为wordpress制作自定义评论列表

I am trying to customize the wordpress comments list that is retrieved using the following function

<?php wp_list_comments('avatar_size=64&type=comment'); ?>

I am trying to use the following code

<ol class="commentlist clearfix">
                                <?php wp_list_comments('avatar_size=64&type=comment'); ?>
</ol><!-- .commentlist end -->

I have also tried using

<ol class="commentlist clearfix">
                                <?php
                            function my_comments_callback( $comment, $args, $depth ) {
                                $GLOBALS['comment'] = $comment;                              
                                ?>
                                <li class="comment byuser comment-author-_smcl_admin even thread-odd thread-alt depth-1" id="li-comment-<?php comment_ID(); ?>">

                                    <div id="comment-<?php comment_ID(); ?>" class="comment-wrap clearfix">

                                        <div class="comment-meta">

                                            <div class="comment-author vcard">

                                                <span class="comment-avatar clearfix">
                                                <img alt='' src='http://1.gravatar.com/avatar/30110f1f3a4238c619bcceb10f4c4484?s=60&amp;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D60&amp;r=G' class='avatar avatar-60 photo' height='60' width='60' /></span>

                                            </div>

                                        </div>

                                        <div class="comment-content clearfix">

                                            <div class="comment-author"><a href='http://themeforest.net/user/semicolonweb' rel='external nofollow' class='url'>SemiColon</a><span><a href="#" title="Permalink to this comment">April 25, 2012 at 1:03 am</a></span></div>

                                            <p><?php comment_text(); ?></p>

                                            <a class='comment-reply-link'><?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( '<i class="icon-reply"></i>' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?></a>

                                        </div>

                                        <div class="clear"></div>

                                    </div>

                                </li>
                                <?php
                            }
                            ?>

but either way I am not able to get the desired result. How can I go about making a custom comments list in wordpress? Thanks.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料