Wordpress注释未显示在single.php中


Wordpress comments not showing in single.php

注释未显示在single.php 中

这是我在single.php中的代码(我创建了comments.php并从默认的comments.hp文件主题中复制了代码):

<?php get_header(); ?>

<div class="content-post container">
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    <p><?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?> | <?php the_category(', '); ?> | <?php comments_number('No comment', '1 comment', '% comments'); ?></p>
    <?php the_content(); ?>
    <?php wp_list_comments(); ?>

    <?php endwhile; else: ?>
    <h2>Woops...</h2>
    <p>Sorry, no posts we're found.</p>
    <?php endif; ?>
    <p align="center"><?php posts_nav_link(); ?></p>
</div>
<?php get_footer(); ?>

这可能是由于css问题吗?我还安装了Disqus插件,它不显示

这段代码看起来不错。可能有两件事:

在管理区域,转到张贴您的查看并找到"允许评论"复选框,如果您的主题允许的话。

尝试更改代码:

wp_list_comments();

至:

comments_template();

如果不起作用,就换回来。

不知道你所说的"css问题"是什么意思。如果是CSS问题,请发表一些评论,然后在浏览器中查看页面。查看页面源代码,如果注释设置为显示:none,您仍然可以在页面源代码中看到它们,那么您就会知道这是否是CSS问题。