• Hi,

    I’am trying to use this code inside the loop on category.php

    <?php
    if( empty($post->post_content) ) {
        // Do stuff with empty posts.
    } else {
        // Do stuff with posts with content.
        the_content();
    }
    ?>

    But “// Do stuff with empty posts” runs even if the_content is not empty. What am i doing wrong?

The topic ‘Check if the_content is empty?’ is closed to new replies.