Bummer! This is just a preview. You need to be signed in with a Treehouse account to view the entire video.
The Comment Template1:30 with Zac Gordon
In some situations you may need to add or edit a comment.php template to customize how comments appear on your site. In this last video of the stage we look briefly at this template.
When you're working with the single.php template or the blogs template,
it's important to also know about the comments.php template.
The comments.php template contains all of the mark up and
code that's used to create the comment form that's used for posting blog posts.
I'm going to do Command+Shift N and open this up in a new incognito tab where
I'm not logged in, so that we can see that this field displays differently,
depending on whether I'm logged in or whether I'm not.
The comments.php template lets you control all of this.
However, I would recommend a few things.
For example, it has a lot of code that's in here for
accessibility reasons, that makes filling out and completing forms a lot easier.
I'd suggest that you don't remove too much of this.
In general, you shouldn't really need to customize the comments.php template.
However, if you do, a general good approach is to start off by going
to one of the default WordPress themes, finding their comments.php file and
using that as a starting point in your own theme,
since there is a lot of mark up that you wouldn't necessarily think to
code out from scratch if you were taking that approach.
You need to sign up for Treehouse in order to download course files.Sign up