wp_list_comments children comments
-
To do what? You can control the display using CSS without needing to change anything in the code.
Of course you can style anything using CSS but but wp_list_comments gives you the option to use your own custom theme and that’s what I want.
I’m not talking about styling comments, I’m talking about not nesting children comments inside their parents.
Any ideas?
You want to remove threaded comment support?
Nope, It seems that I’m terrible at explaining myself 🙂
I want threaded comments but i don’t want the markup to nest inside the parent comment container.
The thing is that wp_list_comments allow to create a custom theme but since the function adds the closing tags autommatically I don’t really have so much control over the markup.
Can you give an example of the problem, in code form…
I think i know what you’re referring to, but i need a refresher on the specifics…
If you know what to expect from the output, you should be able to make it work however you want.. (in theory)
This is a simplified code example.
wp_list_comments(type=comments$callback=my_theme); function my_theme($comment, $args, $depth){ $GLOBALS['comment'] = $comment; <li class="comment"> <!-- comment avatar, text, etc... --> }This is working so far, but I want to customize the children comments container too and it seems that it isn’t possible.
Ok, what i’m getting at is that you know what elements are going to be closed, and you know which ones are already open…
So this part… (for example’s sake)..
<li class="comment"> <!-- comment avatar, text, etc... --> }..could be…
</li><!-- close the previous list element --> </div><!-- i dunno, maybe you have a div to close to? --> <!-- Do something else, blah blah blah... --> <div><!-- the imaginery div opening again --> <li class="comment"> <!-- comment avatar, text, etc... --> }… it’s hard to give a better example without more of the code…
What i’m getting at is, as long as you know what elements to expect, you can close and open extra elements as appropriate..
Sorry if the example doesn’t make much sense, if you need further help please post additional markup so i can provide a more tailored example..
lol, again it seems that i’m terrible at explaining myself.
What I want is edit the children container to add certain things like a button to hide/show the reply comments, but since the function doesn’t give you control over the children container, I can’t.
Perhaps I’m asking something that I have to do with a plugin or something and not directly inside the callback.
The topic ‘wp_list_comments children comments’ is closed to new replies.
(@ozzysong)
16 years, 2 months ago
Hi,
I’m working on a custom comments template and so far is working correctly.
The problem is when wp_list_comments shows the children comments, it nest the comment inside the parent one.
Because wp_list_comments adds the trailing tag to the loop I can’t control that.
Is there a way to detect children comments or/and get rid of automatic trailing tag adding?
Thanks and sorry for my english.