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:
- 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();
}
}
- 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.