wp_list_comments() 不起作用 [英] wp_list_comments() not working

查看:25
本文介绍了wp_list_comments() 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从头开始创建了一个自定义主题,没什么特别的,简单的主题.我目前使用的是 Wordpress 3.2.1.我把wp_list_comments()放在comments.php里来列出评论,根本不起作用!没有评论显示.尝试将其放入 single.php,也尝试停用所有插件 - 仍然没有.我使用了默认函数,只是 wp_list_comments();没有任何争论.有人可以建议为什么它可能不起作用吗?

I've created a custom theme from scratch, nothing fancy, simple theme. I'm currently using Wordpress 3.2.1. I put wp_list_comments() in the comments.php to list the comments, and it doesn't work at all! No comments displayed. Tried putting it in single.php, tried also deactivating all the plugins - still nothing. I used the default function, just wp_list_comments(); with no arguments. Could anybody suggest why it might be not working?

推荐答案

您是否尝试过 <?php comments_template();?> 在 single.php 中?您似乎在上面的评论中暗示您正在执行类似 <?php include('comments.php')?> 这将不起作用,因为尚未查询评论从数据库--comments_template() 执行此操作,然后将 comments.php 包含在您的主题根目录中.

Did you try <?php comments_template(); ?> in single.php? You seem to imply in your comment above that you were doing something like <?php include('comments.php')?> This won't work, because the comments haven't been queried from the database--comments_template() does that, then includes comments.php in your theme root.

这有帮助吗?

这篇关于wp_list_comments() 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆