You code works where the function the_excerpt
is used. It does not work when get_the_excerpt
is used, which does not apply the the_excerpt
filter. It applies get_the_excerpt
instead.
Using get_the_excerpt
will cause the filter to apply to both the cases since the_excerpt()
uses get_the_excerpt()
.
Automatically generated excerpt content is a different thing since it is created by a filter on get_the_excerpt
that strips the markup.
Related Posts:
- Using wp_trim_excerpt to get the_excerpt() outside the loop
- Remove more or […] text from short post
- How can i limit the character length in excerpt? [duplicate]
- apply_filters() and the_excerpt are giving unexpected results
- How can I create a “Read More” link using the_excerpt() on a static front page?
- Compare the_excerpt() to the_content()
- How to include line-breaks in the_excerpt?
- How to control manual excerpt length?
- How to get the unfiltered excerpt, without […] or auto-excerpting
- Remove “Continue Reading” Link From the Teaser Excerpt Only
- Display Links in Excerpts?
- excerpt in characters
- How do I filter the excerpt metabox description in admin?
- Modify youtube video size on one page and show another size on different page
- Remove Ellipses from Excerpt
- Read more tag shows up on EVERY post
- Issue with enabling formatting in excerpts in WordPress
- limit the words in the post content and add read more link
- wp_trim_words() does not trim the_content() in WordPress
- Custom excerpt length on home page
- Excerpt Word Count
- the_excerpt() or get_the_excerpt with shortcode escape
- Limit the_excerpt in the first point (.) of the sentence
- How to show only manual / custom excerpts?
- Excerpts that don’t truncate words
- Spacing within the excerpt
- Modify Twenty Fourteen Home Page Content Limit & Add Read More Link
- Custom CSS for full post vs. excerpt (Content Options)
- Custom Excerpt is returning 52 characters and not 52 words
- Limit the Excerpt field in WP-Admin in words
- Disable WYSIWYG rich text editor only on post excerpt
- “Read more” link doesn’t show up when the post length is under the excerpt length
- How do I disable excerpts on blogs and website
- How to remove “Read on” content in the_excerpt?
- the_excerpt Read More Filter
- excerpt_length not working
- How to get the excerpts of all children pages
- How to programmatically bring back “excerpts” field in post editor in WP 3.1+
- Custom excerpt showing first paragraph (with HTML formatting)
- Regenerate auto excerpts after updating many posts
- Read more does not show up when I write my own Excerpt
- Empty excerpt using wp_get_recent_posts
- can hyperlinks be displayed in excerpts?
- Making oEmbed work on the excerpt field
- Remove whitespace before the_excerpt();
- Different ‘read more’ links
- The excerpt: Display text OR image OR video
- How to get excerpt correctly formatted
- How to display only the excerpt in the blog/posts page with Gutenberg?
- Read More for Excerpt not working
- Twenty Fourteen: Change Read More text
- Read more on the post page itself
- wp_trim_words is trimming by character instead of by words
- Global, network-wide shortcodes or text replace functions
- Bulk add tag (or any sort of label) to posts who have custom excerpt
- printf and _n in this example?
- adjust the_excerpt based on template page
- Extending wordpress search to include excerpts and taxonomies?
- First letter cutting off in excerpt
- How to correctly limit the content and strip HTML?
- How to display links in excerpt? [duplicate]
- Getting the_excerpt to link to child pages [closed]
- Writing a custom excerpt function
- Getting first 20 words without excerpt
- Change excerpt length of first post
- Display oEmbed in the_excerpt
- Show read more link next to last word
- the_excerpt – want to modify password protected output
- Auto Populate Excerpt Field
- Excerpt – add the last few words of posts to the […]
- excerpt – don’t use main content if empty
- Any way to get more space for editing post excerpts
- Remove Text within Header tags in the Excerpt
- Show validation warning if no Excerpt is added
- How can I add more code to this?
- Excerpt is only getting shown for first post
- WordPress Post Format If Statement?
- Excerpt Problems
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- Function to shorten string without cutting off last word
- How to show excerpt field
- Implementing a blog excerpt in custom theme
- Get the excerpt of post_content
- Get a raw value of excerpt
- Post content not showing
- Need to show post summary in sidebar
- Excerpt length and alignment [duplicate]
- Export Posts in excel [closed]
- Opening file, editing, save, exit, open, edited version opens?
- Limited excerpt with readmore
- Remove automatic excerpts only for single posts
- Setting post excerpt length in php wordpress code, Should will help to save DB size?
- Remove the excerpt and “… Read More” from the featured content on the home page with child theme
- Format main page post excerpt previews
- Is there a way to display the ‘Read more’ link if it’s within a range?
- HTML in excerpt WordPress 6.2.2
- Display Rank Math Meta description at the beginning of single post
- How to share to Facebook as an excerpt?
- Fix count of lines of excerpt block (or any block)
- Excerpt selected content automatically