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?
- How to show page content in feed?
- apply_filters() and the_excerpt are giving unexpected results
- remove_filter( ‘the_content’, ‘wpautop’ ); only for certain post types
- Valid characters for actions, hooks and filters
- How do I filter the excerpt metabox description in admin?
- How do I use the ‘http_request_host_is_external’ filter
- AJAX filter posts on click based on category
- Can I add custom meta for each image uploaded via media-upload.php?
- How do I know if author field was changed on post save?
- Some questions regarding filter
- Problem getting single_template filter to work – I want to serve a different single.php file for posts in a certain category
- Too many actions/filters!
- Exclude filter on front page
- Which hook is fired when inserting media into a post
- How can override a add_filter of a plugin?
- Adding Filter Conditionally Per Page ID
- How to change domain used when pinging sites
- return values from hooks do_action and apply_filters, which is better
- Return a custom value in a function added to an action hook
- Using Conditional Statement in functions.php
- get_title without filter(the_title)
- How to filter out shortcode when displaying the_excerpt() in the loop?
- Multiple filters for wp_get_archive
- Function the_content not working
- Is there a filter called ‘network_admin_init’?
- Break out of wordpress filter
- WP action/filter to modify title before header output and article output?
- Custom view counts not updating correctly
- How to create Woocommerce Product Filter Widget [closed]
- Filtering Comment Reply Links (comment_reply_link_args) for “infinite replies” in nested comments
- Create Search Form to Filter Through Terms
- Formatting get_post content doesn’t allow JS content to function properly
- add_filter with retrieve_password_message() not working in plugin, but works in functions.php
- Add a div of content within the_content after a certain block
- Gutenberg Block – Post Featured Image Filter Hook
- separate categories with comma and srounded by single quote
- Prevent add_filter being applied to wp-admin pages
- Translate custom order status through a filter?
- Using preg_replace() with the_content filter
- Filter everything from content except output of a shortcode
- Is there a way to globallly apply esc_html( … ) to all inputs and anchors to filter out XSS markup?
- Filter get_page_by_path()
- Handle multiple parameters in filter
- Want to use wp_get_current_user() in query filter
- WP 4.5 hide core customizer sections
- Custom nav walker: How to acces the $args parameter?
- alternative to the_content filter
- How to set a filter search for categories of blog posts in wordpress
- Same URL for portfolio and for a page creates 404 error. Is there any filter that i can use for a child page?
- Filter widget_posts_args not working
- How can I filter the comment action links so that I can display the actions links based on user capabilities?
- Adding link options in insert/edit link dialog window
- WordPress Tag Cloud Filter Prevents Widget HTML from loading
- Using add_filters() , apply_filter(), add_action() and do_action() in extending a plugin
- Hide a specific post from Archive Feed
- Filter for wp_embed_handler_youtube not working
- Post Type Upload Directory – {post_type}_upload_dir filter
- Custom xmlrpc request does not pass parameters?
- Custom registration field to SQL database
- Problem with shortcodes in external file
- WordPress URL rewrite problem
- How to reset/remove added filters ‘posts_join’ and ‘posts_orderby’ after the loop is completed?
- How to turn this customized core function into a filter/action in functions.php?
- Which hook should be used in this case?
- manage_users_custom_columns filter not firing callback functions
- How to use apply_filters(‘get_calendar’) to change get_calendar() output?
- How to add custom HTML attribute to reusable block div in WordPress admin
- Using two posts_orderby add_filter makes conflict
- Is there a way to check if the ‘wp_sitemaps_enabled’ is true or false?
- Block Gutenberg Editor manually by User Roles with a Filter with code
- How to use add_filter to add the extra data to existing array?