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.

As we know we can usually make changes to "the content" by calling the_content(). is there any equivalent function available for comments? or any such way do you know?

share|improve this question
add comment

2 Answers 2

I do hope I understand what you're asking, as you're not giving much information. From what I specifically to customize the output of your comments.

Well, there partially is. The wp_list_comments accepts a callback argument among several others. This callback allows you to run a custom function; in your case, a custom function to manipulate the comments' markup/output.

So, let's get started. Assuming your HTML structure looks somewhat like this:

<ul class="comments">
   <?php $args = array(
        'type'          => 'comment',
        'callback'        => custom_comments
   );
   wp_list_comments($args); ?>
</ul>

Then, you would create a function called *custom_comments*, that would look something like this: function custom_comments($args, $comment, $depth) { // your code.. // example from DigWP: http://pastie.org/2986583 }

Hope that helps!

share|improve this answer
add comment

This codex lists many functions for comments.

share|improve this answer
    
Thanks,I checked that.But I didn't found what I'm searching for. –  Yasir Adnan Dec 9 '11 at 4:39
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.