if ( have_posts() ) : while ( have_posts() ) : the_post();
the_content();
endwhile;
endif;
And if you’d like to display the content conditionally only if there’s content, here’s what you do
if(get_the_content()){
echo '<section>';
if ( have_posts() ) : while ( have_posts() ) : the_post();
the_content();
endwhile;
endif;
echo '</section>';
}
Have any questions or comments? Write them below!