// get the manual excerpt $post = get_post( $page->ID ); $the_excerpt = $post->post_excerpt; // if manual excerpt is present, show it otherwise first 40 words of the Page content if ( empty( $the_excerpt ) ) { echo '
' . excerpt( '40' ) . '
'; } else { echo '
' . $the_excerpt . '
'; }