Skip to content

Instantly share code, notes, and snippets.

@BeardedGinger
Created December 9, 2013 19:36
Show Gist options
  • Save BeardedGinger/7879412 to your computer and use it in GitHub Desktop.
Save BeardedGinger/7879412 to your computer and use it in GitHub Desktop.
Check if the post has content - WordPress
<?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