Does anyone with experience using WordPress know why it would not use my comments.php
file that is in a theme folder?
Leave a Reply
You must be logged in to post a comment.
Does anyone with experience using WordPress know why it would not use my comments.php
file that is in a theme folder?
You must be logged in to post a comment.
I got it working now, I had to change
<?php comments_template(); ?>
into this
instead, weird but it fixed my problem
If you already have
<?php comments_template(); ?>
in place (which you do) then it could be a file permission issue.Also, it is probably pulling from
classic
ordefault
if it can’t read yourcomments.php
file in the current directory of your theme.Make sure your
comments.php
has the same permissions as the rest of your theme files.You need to include the following in your template’s single.php to include comments:
Use the default template that comes with WordPress as a reference.
Doug Neiner added this as a comment first so if he posts it as an answer please choose his.
I think I found solution.
Problem that my theme not using single.php while it loads. So adding comments_template(”, true); not helping.
So I added it to my index.php file and it appears now like it should.
Hope this will help
This is typically done with the comments_template function:
$file is the file name you want to load (for example, “/comments.php”). It’s an optional parameter.
$separate_comments is used to set whether to separate the comments by comment type. It’s boolean, and the default is FALSE. It’s an optional parameter (if you omit it, it’s set to FALSE).
NOTE: This only works for single posts and pages. To make it work everywhere, set $withcomments to “1”.
If you want to create your own custom comment template (like for a custom theme), call it like this, for example (“short-comments” is just an example name):
If you’ve done all this and WP still isn’t using the correct comments.php, check file permissions. Also–hacking comments is a common problem, so someone may have hacked your site and caused a problem with the file.