Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

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

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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.
share|improve this answer
1  
thx, I think I found a great example of doing this: sanisoft.com/blog/2010/04/05/… I just need to understand it and implement :D –  Sandro Dzneladze Sep 22 '11 at 11:12
    
@Sandro Nice tutorial. Thanks for posting. –  rofflox Sep 22 '11 at 12:41
add comment

Go to Settings->Discussion and disable threaded comments.

share|improve this answer
    
that's a good one :) I want to use threaded comments, but customize it... disabling it won't help situation :P –  Sandro Dzneladze Sep 21 '11 at 23:53
    
You could use jquery to move all nested comment underneath their parent li. –  Brian Fegter Sep 21 '11 at 23:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.