WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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
up vote 4 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

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 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
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

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

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

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

Your Answer


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.