做了一个关于我的页面

2025-11-13 153 2

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

是老哥的友情链接申请,然后我发现我博客做了这么久了也没有做个关于我的页面或者留言的页面,导致老哥在文章中留言。这是我的疏忽。然后就马不停蹄的在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(); ?>

修改后在回来刷新一下就可以了。前提是你的设置讨论里面也开启了允许讨论哟。欢迎大家来留言评论哟!欢迎大家来互联!


相关文章

ai时代的便利性[随笔]
定格这一刻:我们的快乐动物园
今天就适合吃猪蹄藕汤锅
记录下上Python编程课在线录像
2025年入冬的第一顿豌豆颠
今天见证了历史性的一刻重庆三区合并

评论(2)

  1. Safari 18.7.1 Safari 18.7.1 iPhone iOS 18.7.1 iPhone iOS 18.7.1
    Mozilla/5.0 (iPhone; CPU iPhone OS 18_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.7.1 Mobile/15E148 Safari/604.1

    慢慢完善就好了 之前有友友访问我的小站 找不到留言的地方 也是在文章中留言 后面我加了三言两语留言板 就解决了

    1. Microsoft Edge 139.0.0.0 Microsoft Edge 139.0.0.0 Windows 10 x64 Edition Windows 10 x64 Edition
      Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0

      @刘郎 好的,老哥

      @刘郎

发布评论

在线客服
我们将24小时内回复。
2025-12-10 04:45:33

您好,有任何疑问请与我们直接联系!

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: