CCDzine
4/2/2016 - 5:05 AM

Fallback text for WordPress posts that have no excerpt set on the edit screen.

Fallback text for WordPress posts that have no excerpt set on the edit screen.

<?php

$excerptAlt = 'This is my fallback text.';

if ( has_excerpt() ) { echo get_the_excerpt(); } 
else { echo $excerptAlt; }

?>

Fallback Excerpt Text

WordPress Snippet