wordpress中不显示内容

2025-11-27 10:05:15

1、如题,很多教程都是说填写<?php the_content(); ?>可以显示霸科文章内容。但是召牺吩事实并非如此。我们在做single.php的时候。填写<?php the_content(); ?>不显示文章内容显示是空白的,但是填写<?php the_title(); ?>却能显示标题名

2、<?php if(have_posts()) : while (have_posts()) : the_post() ?><h3 class="text-center"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php the_content(); ?> <?php endwhile; endif; ?>

可以试试这段代争冷码。

貌似没有<?php if(have_posts()) : while (have_posts()) : the_post() ?>就不能输出内容。

3、此文只针对php新手,别问我为什么。

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢