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
- GET the excerpt by ID
- How to end the excerpt with a sentence rather than a word?
- Apply the_title() filter in post & page title, but not in menu title
- Update post counts (published, draft, unattached) in admin interface
- Removing any and all inline styles from the_content()
- Removing filter dropdown in posts table (in this case Yoast SEO)
- Get old values for post before saving new ones
- 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
- Remove image caption from post excerpt
- 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?
- widget should display post archive by year and on click also by month
- how to display full post with pagination on home page
- how to display post content without post image?
- Exclude category on blog list page
- How to remove_filter that filters iframes in posts? [duplicate]
- Filter posts by author and category simultaneously
- blog page showing only first post
- Filter post before *editing*
- Filter/Remove HTML Elements on all posts and pages
- Single Post Gallery Using Shortcode
- How to add an admin function only to posts, not pages?
- How to customize read more link
- Showing random content / pictures from earlier posts in a sticky post?
- Custom wp_trim_words() function not trimming right
- How to share same post to multiple site in wordpress?
- how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?
- Side by side blog posts that are tied together
- How to show post(excerpt) from specific category on wp page?
- How to link up “read more” on excerpts hack from WP Recipies
- If specific user role then sticky post
- Append Text to $post->post_excerpt
- Frontend Post Excerpt field mapping
- Allowing the SoundCloud player to appear in a post excerpt
- Auto Refresh Post List after X seconds
- How to show video from specific category on sidebar?
- Get post excerpt and title by specific post ID?
- Getting post id from wp_insert_post_data function?
- the_posts filter been called multiple time
- Filter Posts By Tag
- 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?
- Only display posts after current date
- Amend wordpress password function
- Custom Post Templates
- Display most recent post in full, excerpts of older posts
- Limit Gutenberg blocks available to users to choose from
- How can I remove posts of a certain category from homepage after a specified time period?
- How to generate numbers indistinguishable for the IDs of the posts
- How to filter posts that belong to a specific category only if that is the only category
- Blog Posts not showing title
- How to retrieve the postID in a “image_send_to_editor” hook function?
- Filter Custom Post Type by Category with Ajax
- Ajax posts filter by date, comments, top views, top likes
- Remove certain post-formats from showing in blog?
- How to add Tags Filter in wordpress admin dashboard
- How blog page in WordPress works : blog page retrieve first post ID
- pre_get_posts query between 2 dates (date stored in custom post meta)
- Applying $posts_clauses filter to specific queries only
- how to remove dash (-) post status from post title on posts listing page wordpress
- Blog Posts in Custom Menu
- Admin Posts Table Column Fitlering is not working for Custom Post Type
- Get latest posts from WordPress site without header, menu and sidebar
- Modify Image Source With The_Content Filter?
- Why is my Blog Page ID == First Post ID?
- Displaying Latest Posts on a Page
- Add blogs to “Blogs i Follow” sidebar [closed]
- Print a message if excerpt is empty after posts have been publish/update!
- How to make number of blog posts a custom field?
- Choose whether to automatically add a taxonomy with the same name as the post
- How can i display gallery shortcode output under Post text
- Display posts from a different website on Genesis Responsive Slider
- What is the filter or hook to add admin controls to posts on the front end?
- WP Bakery Load More Button loads the same posts
- Change post order random through out the entire WordPress
- use wpml_post_language_details function other plugin based on $post->ID [closed]
- add new post default view
- How to hide html tags on revision comparison pages?
- Add filter by custom field to block of posts
- get_the_excerpt() is not working as expected – returns wrong text
- Ajax post filters not working
- Show certain posts in a LIST format that members have been granted access to
- Default to ‘all’ view on the ‘edit-post’ screen for authors
- Display Meta Values in Custom Filter – Admin Custom Posts
- How to filter my search in post if contains a word in title, content or excerpt?
- More then one menu items are assigned with “current-menu-item” class
- Append class to posts page
- Update post_content everytime a custom post is opened in backend
- How do I display some posts fully on the homepage, and some as an excerpt only?
- Posts and Attachments with “Published” status in Search
- How to disable WordPress blog folder
- How could I change my Permalink from blog to custom structure? [closed]
- Posting blog entries in screenplay format