Skip to content

Instantly share code, notes, and snippets.

@data-enhanced
Created June 9, 2015 18:11
Show Gist options
  • Save data-enhanced/3a7c980bec460c8139a2 to your computer and use it in GitHub Desktop.
Save data-enhanced/3a7c980bec460c8139a2 to your computer and use it in GitHub Desktop.
WP Post Excerpt -- only if an excerpt is entered
<?php if ( !empty( $post->post_excerpt ) ) : // if the excerpt field is not empty
the_excerpt(); // do the excerpt
else : // if the excerpt field is empty
false; // no excerpt
endif; ?>
<!-- see: https://wordpress.org/support/topic/if-the_excerpt-is-blank -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment