Child Comments (Replies) Don’t Validate
-
Somewhere between my comment code and the built in comments-template.php creating the code I’m getting extra ‘s and not having the <ul class=’children’> put in the right spot. All of this is causing the page not to validate. I can’t seem to figure out why it’s happening or how to fix it. I would love some help. Thanks guys!
This is a theme I’m testing and so it’s not yet live. If you click off the page you’ll have to add ?theme=Limb%20Kulers to the end of the URL.
Page in question: https://justincox.com/2009/lost-the-incident/?theme=Limb%20Kulers
comments.php excerpt:
<?php if ( have_comments() ) : ?> <a name="comments"></a> <div class="comments"> <h2><?php comments_number('No Comments', 'One Comment', '% Comments' ); ?></h2> </div> <ol class="commentlist"> <?php wp_list_comments('callback=comment'); ?> </ol> <?php else : // this is displayed if there are no comments so far ?>
functions.php excerpt:
<?php //Comment Reply Hack (https://bavotasan.com/tutorials/how-to-add-nested-comments-to-your-wordpress-theme/) ?> <?php function comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li id="comment-<?php comment_ID() ?>"> <div <?php comment_class(); ?>> <div class="comment-meta"> <?php echo get_avatar( $comment, 72 ); ?><br /> <span class="date"><?php comment_date('n/j/y') ?></span><br /> <span class="time"><?php comment_time('g:ia') ?></span> </div> <div class="text"> <h1><?php comment_author_link() ?><?php edit_comment_link('‡', ' ', ''); ?></h1> <?php if ($comment->comment_approved == '0') : ?> <em>Your comment is awaiting moderation.</em> <?php endif; ?> <?php comment_text() ?> <?php if($args['max_depth']!=$depth) { ?> <p class="reply"> <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> to <?php comment_author_link() ?> </p> <?php } ?> </div> </div> </li> <!-- End Comment <?php comment_ID() ?> --> <?php } ?>
- The topic ‘Child Comments (Replies) Don’t Validate’ is closed to new replies.