Check if the_content() has content

Last modified March 27, 2019
.* :☆゚

This is a handy way to check if the_content() actually has content saved. Useful if you don’t want to output any unnecessary wrapper elements.

<?php if ( get_post()->post_content !== '' ) {
    get_template_part( 'template-parts/content', 'page' );
} ?>