Comments.php Cannot find comment_form
-
That’s not what it’s looking for.
I made a post a little more than two years ago explaining exactly how to do this. The
comment_form()function has been around since WordPress 3.0, and you should really be using it instead of hardcoding your comments form like that.More info: http://ottopress.com/2010/wordpress-3-0-theme-tip-the-comment-form/
Also, you have another post on this topic already. Please don’t double post.
http://ww.wp.xz.cn/support/topic/preferance-comment_form-or-comments_template?replies=3
Sorry, since I saw the topic closed, I though to be illegal to continue it.
Thanks,
I placed the code you show me on that wonderful link it tells me that I need; but the comments still not show. See please: http://bit.ly/YMaMef
I am adding <?php comment_form(); ?>
If I put <?php comments_template(); ?> the comments show up.
Thanks,
Ah, I mean, if I place in single.php <?php comments_template(); ?>
The comments show up, but theme-check tells me that I am missing <?php comment_form(); ?> which is true.
A funny dilemma, all I want now in live to validate WordPress Themes.
Samuel, you are helping me to be a better, person.
Thank you,
You don’t put the comment_form call in single.php, you put it in the comments.php, replacing the comment form code that you have there already.
Got it, I placed this instead of the much code there and it worked:
<ol class="commentlist"> <?php wp_list_comments(); ?> <div class="navigation"> <?php paginate_comments_links(); ?> </div> <?php comment_form(); ?>One last question, if some one just press post a comment, but does not fill any fills, then they get a blank page that says:
http://mywebsite.com/wp-comments-post.php
ERROR: please type a comment.
Is there a way around this? I do not like people looking under my hood if you know what I mean.
Thanks,
No, that’s core functionality. If they hit submit without typing a comment, then the WordPress core tells them to do so.
Ah, ok,
Thanks,
Thank you dude.
The topic ‘Comments.php Cannot find comment_form’ is closed to new replies.
(@mevaser)
13 years, 5 months ago
I am validating a Theme, the last thing to validate is comments.php.
The problem is that the single.php is using: <?php comments_template(); ?>
Then the theme cannot find <?php comment_form(); ?>. I was told that this code line should be in comments.php and it is:
<?php do_action(‘comment_form’, $post->ID); ?>
Any help?
http://ww.wp.xz.cn/extend/plugins/theme-check/