WordPress at Your Fingertips

has_excerpt() WP 1.0

Whether the post has a custom excerpt.

For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.

No Hooks.


true|false. True if the post has a custom excerpt, false otherwise.


has_excerpt( $post );
Post ID or WP_Post object.
Default: global $post


Since 2.3.0 Introduced.

Code of has_excerpt() WP 5.8.1

function has_excerpt( $post = 0 ) {
	$post = get_post( $post );
	return ( ! empty( $post->post_excerpt ) );

excerpt (fragment, snippet)

Conditional tags (all)

Posts, pages...

No comments
    Log In