在页面模板PHP文件中显示Gutenberg内容

时间:2019-06-06 00:09:33

标签: php wordpress wordpress-gutenberg

我花了很多时间尝试使用WordPress和新创建的名为Gutenberg的编辑器来创建页面。在Wordpress中,我始终使用:

<?php the_content(); ?>

以显示内容,但不适用于Gutenberg。当我在PHP页面模板文件中使用Gutenberg时,有什么新的显示内容的方法吗?

1 个答案:

答案 0 :(得分:1)

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

if ( have_posts() ) { 
    while ( have_posts() ) : the_post();
        the_content();
    endwhile;
}
相关问题