Forked from bhongy/Wordpress: Do if the_content is not empty
Created
June 28, 2017 22:52
-
-
Save jfeliweb/3d73753a046882e847659a89e8327979 to your computer and use it in GitHub Desktop.
Wordpress: Check if the_content is empty / do something only when the_content is empty
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 | |
$thecontent = get_the_content(); | |
if(!empty($thecontent)) { ?> | |
// do or output something | |
<?php } ?> // break php tag for HTML block |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment