WordPress at a glance

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-includes/post-template.php WP 5.2.4

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

Related Functions

From tag: excerpt (fragment, snippet)

More from tag: Conditional tags (all)

More from category: Posts, pages...

No comments
    Hello, !     Log In . Register