Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Theme Development Adding a Blog to a WordPress Theme Adding Comments to a Template

Comments.php suggested since WP 3.0

If you turn on WP_DEBUG, you'll get an error if you include comments in your template without a comments.php file. Just a heads up. The comments will still output, but it's apparently best practice to include a custom comments.php in your theme.

Hey buddy. I've been working on adding comments to a blog and experienced the same thing as well. Have you found any good resources for a comments.php template? I've tried the codex but have only gotten snippets out of there.

Could it be as simple as finding a free theme like twenty fourteen and using their comments.php and finding how they implement it with functions.php?

I haven't. I would imagine that you could perhaps copy the comments template that WordPress uses by default. I also found this thread on Stack Exchange that might help:

http://wordpress.stackexchange.com/questions/81950/i-dont-have-comments-php-how-do-i-customize-my-comment-fields

4 Answers

Thanks Zac. I really enjoy your courses here on Treehouse. Keep up the good work!

geoffrey
geoffrey
28,736 Points

Hi there, I turned on the debug mode as well in the wp-config file and so the warning was displayed. There is a topic about that issue here with more info and the link to the file to copy/paste.

Gergely Szabo
Gergely Szabo
6,082 Points

If you use underscores.me It adds the file out of the box. Why didn't you used _ by the way?