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

Debby Beachy
PLUS
Debby Beachy
Courses Plus Student 2,096 Points

Comments in Wordpress

Why not use a plugin instead of custom code comment.php file?

3 Answers

No worries we are all here to help each other :)

l would start by saying the wordpress core is a very important part of wordpress that we all miss. Most of all these plugins use hooks(action and filters) to create the functionality that we need. However others take it all a step further like disqus by adding functionalities that are not native to wordpress.

Some might argue that the comment.php file is a good idea but its soley down to your requirements and functionalities that you want the comment form to have. So lets say you want a comment form that users can comment by using their facebook or google account, which would help in seo? then you would need to use a plugin to make your life easier. But if its to just take a comment then you can create your own on to of wordpress' comment form and style it however you want. This can be done using a hook or just setting the args when getting the comment template part or in your comment.php file then you just get the template part of it.

Debby Beachy
PLUS
Debby Beachy
Courses Plus Student 2,096 Points

Hello Kelvin, Thank you for answering my question. There isn't a right answer, having the comment.php knowledge as a WordPress developer is important to understand.

l might have understood your question but yeah most definately it is important to understand how to create your own comments.php. thats why l started talking about the wordpress core. because knowing how to do it all makes your life easier as a wordpress developer and the root of it all is the core of wordpress. If you understand how it works you can do whatever you want with it.

Does that help or am i still in the wrong direction?