Display Gutenberg content in page template PHP file

Viewed 1092

Firts time I trying to create page using WordPress with new editor called Gutenberg. In Wordpress I Always using:

<?php the_content(); ?>

to display content but it is not working with Gutenberg. Is there some new way to display content when I using Gutenberg in PHP page templates files?

1 Answers

You have to call the_content(); inside the WordPress while loop like below.

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