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条回答

    报告相同问题?

    悬赏问题

    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题