wordpress主题没有评论功能

page.php文件代码如下:

<?php get_header(); ?>
<section class="uazoh7-section">
<div class="container">
<div class="row">
<?php
if(isset($smof_data['blog_sidebar_pos'])) {
if($smof_data['blog_sidebar_pos']=='0') {
echo '<div class="col-lg-12">';
if (have_posts()) : while (have_posts()) : the_post(); the_content();endwhile;endif; uazoh_navigation();
echo '</div>';
}elseif($smof_data['blog_sidebar_pos']=='2') {
echo '<div class="col-lg-9">';
if (have_posts()) : while (have_posts()) : the_post(); the_content();endwhile;endif; uazoh_navigation();
echo '</div><div class="col-lg-3">';
if(isset($smof_data['blog_sidebar'])) {dynamic_sidebar(''.$smof_data['blog_sidebar'].''); }else {dynamic_sidebar('sidebar'); }
echo '</div>';
}elseif($smof_data['blog_sidebar_pos']=='1') {
echo '<div class="col-lg-3">';
if(isset($smof_data['blog_sidebar'])) {dynamic_sidebar(''.$smof_data['blog_sidebar'].''); }else {dynamic_sidebar('sidebar'); }
echo '</div><div class="col-lg-9">';
if (have_posts()) : while (have_posts()) : the_post(); the_content();endwhile;endif; uazoh_navigation();
echo '</div>';
}} ?>
</div></div></section>
<?php get_footer(); ?>

请该如何操作才能显示评论?

你这个没有看到你添加评论函数,

自然就没有文章评论喽。
在倒数第二行的上面添加以下代码,
<?php
if (function_exists('wp_list_comments')) {
comments_template('', true);
} else {
comments_template();
}
?>
应该就可以了。
希望帮到你了。
温馨提示:答案为网友推荐,仅供参考
相似回答