Home / excerpt / No excerpt available, display default message
  • How to No excerpt available, display default message

    no-excerpt-available-display-default-message

    Adding this snippet to your wordpress theme will allow you to display a default message when no excerpt has been added.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    $excerpt = get_the_excerpt();
    if ( empty($excerpt) ) {
    	echo "no excerpt for this posting.";
    }
    echo $excerpt;
    

    ( WordPress codex functions, hooks, in this snippet. )

    get_the_excerpt, the_excerpt, _e, _ex,