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.

My wordpress makes use of custom post templates. I'm now trying to create a custom comments template as well.

I noticed that the comments template is called via this function <?php comments_template( '', true ); ?>

I checked in my functions.php and comments.php but don't see the function being declared anywhere. Can someone please advise on how to go about introducing a custom comments template?

share|improve this question
1  
@Chip Bennet, thanks for the heads up. Reading through that page, I notice that to set up an alternative comments template, i'd have to use this <?php comments_template( '/short-comments.php' ); ?> so am I right in assuming that I can start off by copy pasting the code from comments.php into short-comments.php and then work my way through from there? –  Sledge81 Oct 27 '11 at 13:31
    
You can do it that way, but why? What are you trying to accomplish? –  Chip Bennett Oct 27 '11 at 15:06

1 Answer 1

up vote 1 down vote accepted

The comments_template() template tag sets up the commenting variables and functions, and includes the comments.php template-part file. So, to create a custom comments template, use comments.php.

From there, you will need to get comfortable with the arguments, filters, and callbacks for wp_list_comments(), which is used to output the comment list, and comment_form(), which is used to output the comment-reply form.

share|improve this answer

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.