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

是老哥的友情链接申请,然后我发现我博客做了这么久了也没有做个关于我的页面或者留言的页面,导致老哥在文章中留言。这是我的疏忽。然后就马不停蹄的在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(); ?>
修改后在回来刷新一下就可以了。前提是你的设置讨论里面也开启了允许讨论哟。欢迎大家来留言评论哟!欢迎大家来互联!
如涉及侵权,请通过邮件:gouweicaosheji#163.com与我联系处理。
宗宗酱
慢慢完善就好了 之前有友友访问我的小站 找不到留言的地方 也是在文章中留言 后面我加了三言两语留言板 就解决了
@刘郎 好的,老哥
@刘郎