Created
June 9, 2015 18:11
-
-
Save data-enhanced/3a7c980bec460c8139a2 to your computer and use it in GitHub Desktop.
WP Post Excerpt -- only if an excerpt is entered
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 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