For anyone wondering, as custom excerpts don’t get trimmed by the excerpt_length
filter hook, try adding this filter:
function trim_custom_excerpt($excerpt) {
if (has_excerpt()) {
$excerpt = wp_trim_words(get_the_excerpt(), apply_filters("excerpt_length", 55));
}
return $excerpt;
}
add_filter("the_excerpt", "trim_custom_excerpt", 999);
Related Posts:
- How to show a full post, not just an excerpt
- Modify WP_Post before processing
- Hook for changing excerpt content when excerpt not set
- How to end the excerpt with a sentence rather than a word?
- Removing filter dropdown in posts table (in this case Yoast SEO)
- Disable WordPress’ blogging functionality and disable ‘posts’
- How does filter the_posts work?
- Modify ‘Read more’ link adding a new class
- How to publish a post with empty title and empty content?
- How to add a “publish” link to the quick actions
- How do I convert a mathematical Microsoft Word document to a WordPress blog post?
- Why is wordpress removing some unicode characters (e.g. some emojis) when I save my post?
- blog page showing only first post
- How to show post(excerpt) from specific category on wp page?
- How to link up “read more” on excerpts hack from WP Recipies
- Allowing the SoundCloud player to appear in a post excerpt
- Getting post id from wp_insert_post_data function?
- How can i do something after head like adding a hook for after head but before post
- How to get the post’s parent ID?
- Amend wordpress password function
- Custom Post Templates
- Limit Gutenberg blocks available to users to choose from
- How to generate numbers indistinguishable for the IDs of the posts
- How to retrieve the postID in a “image_send_to_editor” hook function?
- Remove certain post-formats from showing in blog?
- Blog Posts in Custom Menu
- Add blogs to “Blogs i Follow” sidebar [closed]
- Print a message if excerpt is empty after posts have been publish/update!
- Change post order random through out the entire WordPress
- use wpml_post_language_details function other plugin based on $post->ID [closed]
- Default to ‘all’ view on the ‘edit-post’ screen for authors
- How do I display some posts fully on the homepage, and some as an excerpt only?
- How to disable WordPress blog folder
- How could I change my Permalink from blog to custom structure? [closed]
- How to allow visitors to filter posts by multiple taxonomies
- How to remove in-line style of WordPress’s post content only?
- Is it possible to filter the main loop to exclude posts from a specific category?
- Append ‘Continue Reading’ link if post length is more than 3 lines of text?
- older blog posts not showing in new theme
- The_excerpt() doesn’t parse – how to change that?
- Trying to edit archive.php to only show post extract, with featured image
- Why won’t pagination work?
- Modify posts listing at back end
- WordPress Query Posts From Category Post on Static Page
- Prevent posts with certain post_meta to be edited
- How include css class based on post ( in loop ) slug?
- Restrict displaying posts to the poster itself (in Back-end)
- Exclude post category in a blog page
- Exists filter or action that change Add New Post link?
- content summary of a post disappears If an images added at the beginning of the post. how to solve it?
- changing parent_id on post
- WordPress Excerpt Paragraph Limiting
- Grab value of excerpt_length
- Changing The Default Header POST Title and Description text by category in wordpress
- can’t modify post title using the_posts filter
- why my urdu text is not aligned properly when written in wordpress blog post?
- How to add text before post_excerpt in Gutenberg
- user_has_cap filter allows “edit_others_posts” but not is not allowing updating/publishing
- Pagination not give another posts
- “Blog pages show at most” in setting not working
- Using AJAX to filter posts without refreshing page
- Sticky Post Doesn’t always work
- Single Post Gallery Using Shortcode
- blog post not accesible on click [closed]
- How to fix wordpress blog post error? Can anyone help to fix this issue?
- How to pull sticky post permalink inside php?
- Display/Filter post using if else statement
- Dropdown Select Post Filter
- Blog images not showing on homepage
- Enable HTML Tags in WordPress Post excerpt
- How to generate an HTML link automatically from URL in a users’ post
- show only one category and filter by tag
- Multiple Pages – Seperate blogs
- Prevent WordPress from putting around specific element
- filter buddypress users posts by user ‘xprofile’ custom fields
- How do I change the post title’s link on the posts page?
- How to display post excerpt beside post list inside Post of Dashboard
- How to put the WordPress blog into theme
- Printable Page with all Posts from Tag
- Why the blog posts is not showing?
- Hide Admin posts & pages in Dashboard
- How to get the postID inside ‘content_save_pre’? Other hook?
- Filter question list on substring of metavalue
- Blog styling in SASS
- Get results from the main wp_query
- Post List Widget with custom posts and editing the Read More Link
- Hide first blog post in content and output it in widget
- How can I have the posts from one word press blog show on the presentation page of another word press site
- Keep post format class with isotope filter
- Page updates appear in Preview but not live version?
- Add a minimum word count to Excerpt (and how to force Excerpt as a rule for WyPiekacz)
- How to use in_category?
- Posts don’t appear on the Blog page
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- WordPress Custom Theme: My site shows the same posts on Page 1 and Page 2 and so on [duplicate]
- excerpt in template for specific page
- Show full post only to loged-in users
- Add custom PHP (no-SQL) filter to WP_query
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields
- Filters do not work when there are multiple (one works)