gpt4 book ai didi

php - 在页面模板 PHP 文件中显示古腾堡内容

转载 作者:行者123 更新时间:2023-12-04 17:36:37 25 4
gpt4 key购买 nike

我第一次尝试使用 WordPress 和新编辑器 Gutenberg 创建页面。在 Wordpress 中,我总是使用:

<?php the_content(); ?>

显示内容,但它不适用于 Gutenberg。当我在 PHP 页面模板文件中使用 Gutenberg 时,是否有一些新的方式来显示内容?

最佳答案

您必须在 WordPress while 循环中调用 the_content();,如下所示。

if ( have_posts() ) { 
while ( have_posts() ) : the_post();
the_content();
endwhile;
}

关于php - 在页面模板 PHP 文件中显示古腾堡内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56469518/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com