wordpress threaded comments – customize nested ul / how child ul is displayd

I just wasted 1 day trying to make wp threaded comments works… and I think I’m finally done!!!! except that it doesn’t work properly – well it doesn’t work the way I want ! 🙂

Child comments get displayed inside the comment li – I don’t like this behavior, I’d prefer wp to display it right below the parent comment li.

Read More
So by default wp handles it like this:
<li id="commend-1">
comments parent here here
<ul id="child">
<li>child comment reply :P</li>
</ul>
</li>

Anyways, I want it displayed like this:
<li id="comment-1">
</li>
<li id="comment-2" class="isreply">
</li>

Is this possible without modifying core wp files? Did wp developers leave options that enable customization of how child/nested comments are displayed?

I’m including screen shot for better visual.

http://i.stack.imgur.com/8PiJu.png

Related posts

Leave a Reply

2 comments

  1. What you need is a custom Walker. You will probably use wp_list_comments() somewhere in your comments.php template file. There you can pass a walker parameter in the argument array to tell WordPress you want to style the list on your own.

    This requires you to extend the Walker class. The following resources should give you some examples.

    1. Read the codex about the Walker_Class
    2. Check the sourcecode of the base class in wp-includes/class-wp-walker.php or the extending Walker_Comment class in wp-includes/comment-template.php on line 1218.