Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jtsternberg/1838349 to your computer and use it in GitHub Desktop.
Save jtsternberg/1838349 to your computer and use it in GitHub Desktop.
If there's no content, don't display [Continue...]
if ( ! empty( $instance['show_content'] ) ) {
if ( 'excerpt' == $instance['show_content'] ) {
the_excerpt();
} elseif ( 'content-limit' == $instance['show_content'] {
if ( strip_shortcodes( get_the_content() ) != '' ) {
the_content_limit( (int) $instance['content_limit'], esc_html( $instance['more_text'] ) );
} elseif ( get_the_content() != '' && strip_shortcodes( get_the_content() ) == '' ) {
// do nothing
}
} else {
the_content( esc_html( $instance['more_text'] ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment