You’ll need to create a custom callback function with condition such as
if ($depth > 1) {
/* It's a nested comment */
}
Thread Starter
Mark
(@markjcasey)
Thanks again for the reply Joseph… and thank you coco001 for the spam.
I’m actually already using a custom comment display using the callback function.
Where do I slot this condition into the function? I assume it would be here somewhere…
if (!function_exists("custom_comment")) {
function custom_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
Yes, it should be placed somewhere in that function. I can’t tell you exactly where and what to add because I don’t know what’s in it and what you’re trying to do.
The conditions are $depth == 1
and $depth > 1
for parent and child comments respectively.
Thread Starter
Mark
(@markjcasey)
I’m trying to add some extra text on nested comments, that doesn’t appear on the parent ones.
I’ve tried adding this just before the comment reply button from within my custom comment display.
<?php if custom_comment($depth > 1) { ?>
<p>Some text here</p>
<?php } ?>
That breaks my page though : (
Try this:
<?php if ($depth > 1) { ?>
<p>Some text here</p>
<?php } ?>
Thread Starter
Mark
(@markjcasey)
Ah, right. I didn’t need to mention the function again.
Sorted, works a charm. Thanks again.