duangao7133 2018-07-20 14:17
浏览 37
已采纳

在wordpress评论部分没有表格标签

-- wordpress comments section not submitting comment --

I'm adding a comment section at the end of my single.php by calling comments_template(). The comments section loads fine and even shows posts that I've added manually in the admin section.

BUT when I try to submit a post it redirects to front_page.php and the form parameters are added to the url.

I think the problem is that there is no form tag surrounding the comments section in the HTML but I don't know why that is happening.

Things I have done:

  • checked that comments are enabled in the settings page and on specific posts
  • tried adding a form manually around comments_template() but it gets removed
  • made sure that comments_template() is called inside the loop
  • checked i'm calling comment_form() correctly
  • turned off all plugins and still not working

There was a problem previously where I couldn't access the discussion settings in the admin section, this is now rectified so I don't know if it is related.

<?php /*

    comments.php

*/

if ( post_password_required() ) {
    return;
}

?>
<?php
// Do not delete these lines
        if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
        die ('Please do not load this page directly. Thanks!');
        ?>
<div id="comments" class="comments-area">
    <?php comment_form(); ?>
</div><!--  .comments-area -->
  • 写回答

1条回答 默认 最新

  • duanmiaosi0150 2018-07-20 21:38
    关注

    I had an unclosed hidden form tag in an included file. Thought I'd checked all the included files.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元