今天晚上打开博客的时候了,在文章中看到了一条上善若水的老哥评论:

是老哥的友情链接申请,然后我发现我博客做了这么久了也没有做个关于我的页面或者留言的页面,导致老哥在文章中留言。这是我的疏忽。然后就马不停蹄的在WP的后台创建了一个关于我的页面-然后在做关于我的界面的时候,内容我借签了关于军爸的介绍页面。在创建页面完成后啊,发现了一个问题!就是页面没有评论框,这让我头疼起来了,在创建页面的时候也勾选了允许评论怎么会没有这个评论框哎?在网上搜索了一下,发现是page页面没有调用评论所以就没有显示出来。
这是我原来的page.php页面的代码:
<?php get_header();?>
<section class="index_area">
<div class="container">
<div class="post_container_title">
<h1><?php the_title(); ?></h1>
</div>
<div class="post_container mb-4">
<?php while( have_posts() ): the_post(); $p_id = get_the_ID(); ?>
<article class="wznrys">
<?php the_content(); ?>
</article>
<?php endwhile; ?>
</div>
</div>
</section>
<?php get_footer(); ?>
修改后调用评论的代码:
<?php get_header(); ?>
<section class="index_area">
<div class="container">
<div class="post_container_title">
<h1><?php the_title(); ?></h1>
</div>
<div class="post_container mb-4">
<?php while( have_posts() ): the_post(); $p_id = get_the_ID(); ?>
<article class="wznrys">
<?php the_content(); ?>
</article>
<?php
// 添加评论功能
if (comments_open() || get_comments_number()) :
comments_template();
endif;
?>
<?php endwhile; ?>
</div>
</div>
</section>
<?php get_footer(); ?>
修改后在回来刷新一下就可以了。前提是你的设置讨论里面也开启了允许讨论哟。欢迎大家来留言评论哟!欢迎大家来互联!
本站https://ygz.ink文章https://ygz.ink/archives/3297.html中提供的一切软件、教程和内容信息仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则一切后果请用户自负。本站部分信息来自博主网络收集整理,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。如果您喜欢该程序和内容,请支持正版,购买注册,得到更好的正版服务。我们非常重视版权问题,如有侵权请邮件与我们联系处理。敬请谅解!
邮箱:gouweicaosheji@163.com
宗宗酱
