Forked from bhongy/Wordpress: Do if the_content is not empty
Last active
July 1, 2017 19:04
-
-
Save MortenAndersen/61768189c3d393fd31f6 to your computer and use it in GitHub Desktop.
Wordpress: Check om der findes indhold i the_content
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 | |
$content = get_the_content(); | |
if(!empty($content)) { ?> | |
<div class="content"> | |
<h1><?php the_title(); ?></h1> | |
<?php the_content(); ?> | |
</div> | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment