【问题标题】:Display Gutenberg content in page template PHP file在页面模板 PHP 文件中显示 Gutenberg 内容
【发布时间】:2019-06-06 00:09:33
【问题描述】:

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

<?php the_content(); ?>

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

【问题讨论】:

    标签: php wordpress wordpress-gutenberg


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-30
      • 1970-01-01
      • 2021-08-21
      • 1970-01-01
      • 2011-06-12
      相关资源
      最近更新 更多