Skip to content

Instantly share code, notes, and snippets.

@bhongy
Last active September 15, 2023 03:36
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save bhongy/6761732 to your computer and use it in GitHub Desktop.
Save bhongy/6761732 to your computer and use it in GitHub Desktop.
Wordpress: Check if the_content is empty / do something only when the_content is empty
<?php if ( get_the_content() ) { ?>
// do or output something
<?php } ?> // break php tag for HTML block
@bhongy
Copy link
Author

bhongy commented Jul 11, 2021

Thanks, @drdogbot7! Updated the gist per your suggestion.

@quyetlv12
Copy link

if ( get_the_content() ) {
//  do whatever!
}

thanks you for question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment