Despite that I have added the <?php comments_template(); ?>
to single.php
it seems like it’s not working! I’m note sure, but why are the comments in the list of comments to be approved empty? The fields for name, email and URL and the content are empty for each comment.
Should the wp-comments-post.php
be located together with the rest of the theme files or should it be together with the main files?
What could be the cause of this problem?
The function
comments_template()
looks for a file called comments.php in the root of your themes directory. The code inside comments.php should look like the following:however, if you have a different theme directory layout, for example a custom comments.php, you can pass its path in as the funcion parameter. For example, if your theme had a modules direcotry:
Conclusion
This could be a code problem or a misuse of the
comments_template()
function. I recommend you don’t change any WordPress code as it will just be overriden by future updates.This answer is based on: https://codex.wordpress.org/Function_Reference/comments_template
Code Drops taken from:
http://code.tutsplus.com/articles/unraveling-the-secrets-of-wordpress-commentsphp-file–net-28