Created
December 9, 2013 19:36
-
-
Save BeardedGinger/7879412 to your computer and use it in GitHub Desktop.
Check if the post has content - WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Check if the post has content | |
if ($post->post_content == '') { | |
//* Content if post is empty | |
} | |
//* Alternate | |
if (get_post()->post_content == '') { | |
//* Content if post is empty | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment