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 am using wp_list_comments() function to draw the comment list.But,I want change many things in the form like class,styles, reply link and etc...

so please help me, How can i customize the comment listing function

Thanks

share|improve this question
    
Do you really mean form (used to submit new comment) or listing of existing comments? –  Rarst Jun 28 '11 at 13:05
    
@Rarst:listing of existing comments ! –  gowri Jun 28 '11 at 13:07
add comment

5 Answers

up vote 2 down vote accepted

The wp_list_comments() call accepts a callback argument, in which you can define the specifc comment-list markup that you want. I would suggest taking a look at how TwentyTen handles the wp_list_comments() callback.

share|improve this answer
    
Exactly i was looking for this. many thanks –  gowri Jun 28 '11 at 14:30
add comment

You could just take a look at the Codex Page for wp_list_comments which has some example code for customising comment listings.

You will see from that page that you can add a callback function to wp_list_comments which is normally used to customise how comments are listed

share|improve this answer
1  
+1 I kinda forgot that it takes callback as well. That might be easier than custom Walker. –  Rarst Jun 28 '11 at 13:38
    
Twenty Ten uses a comment callback function which might be a good example to start with. –  Michael Jun 28 '11 at 13:59
1  
Updated answer to specifically mention the callback, which was my main reason for suggesting the Codex page. –  anu Jun 28 '11 at 14:03
    
Up-voted since you edited to mention the callback explicitly (thus making my answer redundant, and yours more thorough). :) –  Chip Bennett Jun 28 '11 at 14:30
add comment

wp_list_comments() uses Walker_Comment class (that extends generic Walker) to generate output.

If you need extensive customization you should extend Walker_Comment with your own class and pass instance of it as walker argument to the function.

share|improve this answer
    
can you give me simple example. –  gowri Jun 28 '11 at 13:30
    
@gowri unfortunately nothing about walkers is simple. You need to understand first both mechanics of Walker class in WP (see linked Codex article) and concepts of PHP object inheritance. –  Rarst Jun 28 '11 at 13:36
add comment

Comment is Easily Customaziable. for example: code for cancel the reply link

<?php cancel_comment_reply_link(); ?>

if you want custom the Text like Reply means Replace Text...

<?php cancel_comment_reply_link(text); ?>

Text to display as a link. If empty, it will return the default: 'Click here to cancel reply.'it should be work.

share|improve this answer
    
Do you think,this can solve my whole problem. because I want change many thinks in comment listing. so any other idea –  gowri Jun 28 '11 at 13:10
    
i gave the solution to change your reply link only.not to all.if you want to customize class means you will need to do some more things.... –  Ramkumar Jun 28 '11 at 13:13
    
you may go for that link –  Ramkumar Jun 28 '11 at 13:15
    
even I am not talking about canceling the reply. I just want to replace reply by some images.Anyway thanks for the reply –  gowri Jun 28 '11 at 13:16
add comment

I'd look at using comment_form();. It will give you a default layout of a comment form but you can pass $args to it to modify each section.

share|improve this answer
    
I am taking about comment listing –  gowri Jun 28 '11 at 13:08
    
@gowri but your question says you want to change the form... –  Brady Jun 28 '11 at 14:37
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.