Skip to content

Instantly share code, notes, and snippets.

@ControlledChaos
Last active August 29, 2015 14:26
Show Gist options
  • Save ControlledChaos/02024f1d1bacb07e859c to your computer and use it in GitHub Desktop.
Save ControlledChaos/02024f1d1bacb07e859c to your computer and use it in GitHub Desktop.
Add default text to a post or page when the_content is empty.

Add Default Text to Posts

WordPress Snippet

<?php
$cc = get_the_content();
if( $cc != '' ) {
the_content();
} else { ?>
<p>My filler content goes here.</p>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment