If you are talking about excerpt set manually in the excerpt field of post then you can use following code in the functions.php file of your child theme or plugin to display default excerpt if no excerpt it set.
function display_default_excerpt( $excerpt ) {
if ( has_excerpt() ) {
return $excerpt;
} else {
return __( 'There is no excerpt so displaying default excerpt.' );
}
}
add_filter( 'the_excerpt', 'display_default_excerpt' );
Related Posts:
- Get excerpt from $post->post_content
- How to use the_excerpt in a filter hook?
- add_filter on “the_excerpt” only works when post does not have excerpt
- End excerpt at the end of the sentence
- get_the_excerpt() with fallback like the_excerpt()
- How do I filter get_the_excerpt() but keep all of its functionality intact?
- Buddypress: Edit activity when new blog post [closed]
- Why in archive page doesn´t show read more button with excerpt?
- Access get_the_title() from ‘excerpt_length’ filter
- Give “Read More” precedence over excerpt() word count
- How do I override the_excerpt so that it will display full content?
- the_excerpt filter doesn’t work as expected
- Excerpt is being added above the content, but it should be after it
- run shortcode in excerpt of single custom post type
- apply_filters(‘get_the_content’, $content) + Except
- Trimming a custom field to a length
- Adding html banner to posts
- Apply wordpress filter checking category
- Add Filter – Pass Variable (PHP < 5.3)
- Filter Post Title without affecting screen-reader-text
- Create different flavours of excerpt
- Cutting off excerpt with first sentence
- Auto-generated excerpt with shortcode and read more button/text link
- Read More in the actual excerpt
- is_page_template() doesn’t work with excerpt_length filter
- the_excerpt() does not work with has_excerpt()?
- get_the_excerpt on mobile still displays continue reading
- Custom excerpt_more filter not working when tag is present
- Why does using excerpt_more filter change link location?
- apply_filters() and the_excerpt are giving unexpected results
- Sanitize and data validation with apply_filters() function
- How many filter/action hooks are healthy?
- Filter specific shortcode output?
- Valid characters for actions, hooks and filters
- How to hook into unregistering a widget instance?
- How can I extend the Gutenberg table block transform to allow colspans/rowspans on pasted table elements?
- How do I use the ‘http_request_host_is_external’ filter
- get_option() filtering and getting out of recursion
- AJAX filter posts on click based on category
- How can I filter Microsoft Word gunk from pasted content?
- How to disable all WordPress emails modularly and programatically?
- How do I know if author field was changed on post save?
- Allow Profile HTML for select users
- WordPress 3.5+ upload tool filter
- Search with filters and title
- Some questions regarding filter
- Use content custom filter for all shortcodes
- Filter all html output
- Exclude filter on front page
- Which hook is fired when inserting media into a post
- How to specify which category of the post to use in case of multiple categories
- Return array of images after content
- failed to filter hook `get_terms_defaults`
- Filter list by a unique meta value dilemma
- return values from hooks do_action and apply_filters, which is better
- get_title without filter(the_title)
- How can filters be run when they are never applied?
- How to filter a wordpress core function?
- get_bookmarks filter not supplying query argument (wp 3.1)
- Is there a filter called ‘network_admin_init’?
- ‘the_content’ filter removing html tags from post content
- Using wp_handle_upload() to Direct Specific Path by Using $overrides
- Filter to shorten column content on edit-tags.php
- Formatting get_post content doesn’t allow JS content to function properly
- Proper after_setup_theme and wp_head cleanup
- Why doesn’t remove_action work in my plugin?
- Using a filter to modify Genesis wp_nav_menu
- How can I change the email that is inside the default email texts of wordpress?
- What is the earliest hook to modify post content?
- How to modify only part of a function through the filter
- Modify message displayed on post save
- Something is filtering my shortcodes… Can’t figure out what
- How should I be using filters and is_single together?
- Remove actions/filters that are set with create_function()
- Use has_filter on comment_post
- Hook in a sidebar widget and add some markup
- return get_the_tag_list with whitespace removed
- ‘manage_users_custom_column’ is a filter, but ‘manage_posts_custom_column’ is an action. Why?
- comment_notification_text filter not working
- Modify author url display in edit-comments.php
- WordPress remove_filter not working
- add_filter( ‘the_title’ gets through this if statement twice
- Changing the category for existing Gutenberg blocks
- Hook to change the site URL
- Strange behaviour of REGEX in a WordPress filter (trying to suppress emtpy paragraphs)
- How can I see exactly what arguments are being passed through a filter so that I may modify them?
- Widget image reorganize layout
- WordPress set featured image to first image of the post
- Modify category listing API response
- How to make an If Else on Excerpt Filter
- Converting restricted html in comments to bbcode
- What is the proper/best way to have multiple add_filter for wp-job-manager-resume
- I can get the permalink or the excerpt to work correctly, but not both
- How do I add a class to all sidebars to let a Google Custom Search Engine know not to index the content?
- How to replace all images in all posts and pages with a different size?
- How to add a class to Buddypress avatars in the Activity stream? [closed]
- using posts_where for meta data on pre_get_posts
- can’t output gray scaled image I’ve created using add_image_size
- How properly write function to filter content in a template for plugin “multiple content blocks”
- ACF Load Field Groups Programmatically [closed]