Show Only Manual Excerpt on Single Layout (Solution)

I’ve wanted to show the page excerpt under the headline on my news website. My problem was the {{dc:post:excerpt}} dynamic content would show the automatic excerpt if the manual one was empty.

This is my solution:

  1. Add the following to your functions.php file. Be sure to be using a child theme.

add_shortcode( ‘manual_post_excerpt’, ‘display_manual_post_excerpt’ );
function display_manual_post_excerpt() {
if ( ! has_excerpt() ) {
echo ‘’;
} else {
the_excerpt();
}
}

  1. Add the following shortcode in a text element in your layout.

[manual_post_excerpt]

Et voila!

Themeco crew: It would be awesome if you could add dynamic content that would only show the manual excerpt. Thanks for all you do! Once I found Pro, I haven’t created a single WordPress site without it.

Hello @gavn8r,

Thanks for your comments and your feedback has been noted.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.