0

I made theme and now im finally editing the look of wp_list_comments. I made function, wrote callback link to arguments and tried it. It returns nothing - only elements hard coded in comments.php are displayed (that are just bones for that list...) Ive tried very much ways and nothing worked; comments.php: wp_list_comments(array('callback'=>'ksgcomcall')); ?> functions.php:

<?php 
function ksgcomcall($comment, $args, $depth){
    $GLOBALS['comment'] = $comment;

    ?>
    <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
        <article id="comment-<?php comment_ID(); ?>" class="comment">

            <div class="comment-content"><?php comment_text(); ?></div>

            <p><?php echo "Comment authors age: ".get_comment_meta( $comment->comment_ID, 'age', true ); ?></p>

            <div class="reply">
                <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span>&darr;</span>', 'twentyeleven' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
            </div>
        </article>
    </li>
    <?php
}
?> - its just copy of example from codex..

Can anybody help me, please?

  • Hmm... Time for dumb double checks. Is your function is getting called at all (do something drastic like die() in it)? Is the wp_list_comments() being called from the place you expect (and not different template file or something) ? – Rarst Sep 24 '13 at 20:23
  • Theres no call for die or something like that. The function is called only by callback attr from comments.php and the function is in functions_fc.php added to functions.php by get template part. Every other functions from that file works, only this one not. :( I dont know its not Wordpress 3.5.2 – user1980807 Sep 25 '13 at 5:50
  • Is there anybody who knows how to solve? It's very bad for me... Please – user1980807 Oct 27 '13 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.