Skip to content

Instantly share code, notes, and snippets.

@oneblackcrayon
Forked from lepittenger/index.php
Created June 5, 2022 03:10
Show Gist options
  • Save oneblackcrayon/7d531a3f89d32aa17b964060e4eda4ec to your computer and use it in GitHub Desktop.
Save oneblackcrayon/7d531a3f89d32aa17b964060e4eda4ec to your computer and use it in GitHub Desktop.
Check if the_content is empty
<?php
if ( $post->post_content=="" ) {
// do something for posts without content
} else {
// do something for posts with content
};
// OR
if ( $post->post_content!=="" ) {
// do something for posts with content
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment