Calce

Remodelling in process

wp_list_comments() will append an end tag to your comment

On every call to your call back from wp_list_comments(), there will be an end tag appended, this tag can be either </li> or </div> depending on your style parameter. Therefore, in your call back function, don't put your own end tag there. For example, my call back function was like this:

function custom_comments($comment, $args, $depth) {
  ?>
  <li id="comment-<?php comment_ID() ?>" <?php comment_class(); ?>>
  ...
  </li>
  <?php
}

Perfectly fine, except that there will be another </li> appears when the page shows, making html errors and potentially may break your page's layout. The obvious solution is to remove the </li> tag in my function.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge