Adding the comment functionality

  1. Now, the one thing that is left is comments—we want the comment functionality. This is actually really easy; all we have to do is go to our single.php file and see where we want the comment, which is right under the end </div> tag, as shown in the following code block:
         <?php endif; ?>         <?php comments_template(); ?>      </div>
  1. We can save the code and reload. Here is the output:
  1. We can now see the comment functionality. Let's add Great Post! and then click on Post Comment.

Here is what we get:

  1. We can see that ...

Get Learn to Create WordPress Themes by Building 5 Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.