get_the_excerpt()
returns the excerpt, but only after applying get_the_excerpt
filters to it. This causes infinite recursion, as your filter handler will be called to an infinite depth.
Of course, the best solution is the css one (see @spacegrrl’s answer), but if you have your reasons for keeping that <span>
, please note that the excerpt can be passed as a parameter to your handler. Just add an $the_excerpt
parameter and use that, instead of calling get_the_excerpt()
.
Related Posts:
- Extremely slow pageload for long post when using the_content?
- Problem in replacing the_content with the_excerpt()
- Excerpt all post content Content Same Size without word cutting off
- Allow HTML in excerpt
- How can i remove all html tags from get_the_content()?
- How to return the_excerpt (without echo)?
- Limit the Excerpt field in WP-Admin in words
- Changing the HTML Of the content
- Limit the_excerpt with max of x characters
- append PHP function to the_content
- Remove at the beginning of the_excerpt() with str_replace
- Automatic Excerpt Not Working
- Trim first 2 words of the exceprt
- WordPress Wysiwyg Content not being displayed
- Go to / Scroll to Password Field on WordPress Posts After Submit With Message(s)
- How to change / delete product short description in Woocommerce
- Output 2 items within the Loop
- Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?
- Wrap First Character after in a tag
- Excerpt unwanted text “”
- Word Count Function Preventing Permalink Editing
- Custom excerpt function re-factoring
- How to call function at the bottom of post using plugin?
- How to Display a Single Post Excerpt
- How to remove the excerpt in the Dzonia Lite theme
- Output Buffering – Everything between wp_head and wp_print_footer_scripts?
- Showing content from one page on another
- Mass update excerpt
- How to put “Read more” link in Custom Excerpt inside p tag?
- Error when adding excerpt to the content through functions.php
- Removing “wpautop” (auto tags) only on certain pages?
- HTML tags not showing in excerpt
- Query Pages and post excerpts dynamically
- My custom get_the_excerpt() can’t get excerpt by ID
- Get URL from shortcode tag
- Adding Meta Tags to a Post using its Tags, Excerpt and content
- Using the_excerpt() on a page
- How to debug this search & replace strings snippet?
- Getting content from a referenced post
- Only first shortcode gets executed
- What are the advantages/disadvantages of using jQuery DOM manipulation as opposed to PHP DOM manipulation?
- How to hook code to show after the_content?
- Create a WordPress shortcode using PHP [duplicate]
- How to show an entire post content and not also the excerpt?
- stripping tags from excerpt in WordPress is not working
- Almost Done… Post Format Code
- Automatic excerpt is not shown with the_excerpt() command
- Get the_content surrounded by instead of
- How to turn each phone number within the $content to a telephone link?
- Remove   from the_excerpt
- Shortcodes showing in excerpt despite using strip_shortcodes
- How to remove the space before the ellipsis in excerpt?
- Need help removing […] after excerpt
- WordPress the_content Page Load
- Post class only applying to first excerpt; why?
- Including Custom fields within the_content
- Assign Custom classes to every Excerpt
- Strip from or something better?
- How to Create custom block for displaying information in content section which act like shortcode
- Give ID to divs inside the loop
- Find and print first entry from WordPress post in custom excerpt?
- How to bind each “the_content” elements to a custom variables
- Replace an array (with identical values) with another array in the_content
- Cannot figure out how to add a read more link to a manual excerpt. Please help
- Trying to modify content.php
- How to trim content AND retain HTML?
- How to apply filter
- Is there a way to have chunks of a page’s content expire?
- Add point on excerpt post
- Archive page if else not working for post_excerpt and post_content
- Creating a function that sanitizes the custom metabox excerpt
- How can I add more code to this?
- Merging two excerpt functions to work with conditions
- I can’t seem to get excerpts showing inside get_pages and don’t know why?
- Remove post image caption from post_excerpt();
- generate excerpt from the part of big text dump that contains keyword
- Can’t Find a Way to Edit the Home Page Content [closed]
- Fatal error: Call to undefined function wpsc_cart_item_count()
- Woocommerce Custom CSV export
- Add a Different CSS Class Into The Body Tag of Different WP Pages
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Embed html in php code
- How can I dynamically update the class in my shortcode?
- Concatenate output of php function into string
- Why File_exists returns true with or without ABSPATH?
- Pull GetOption() variable into jQuery dynamically created html
- Shortcode not staying inside div tag
- HTML showing after PHP code in tag
- Adding Author Box Meta Links with Co-Authors
- Can’t pass the variable from a select to PHP query
- “if parent category is” conditional?
- I want to show cart items number if any or nothing, simple CART text
- Language does not switch while cache is enabled
- Set user status to absent on WordPress
- Problem with ajax request and directory structure after site migration
- Access methods in plugin template
- WordPress HTML Helper
- Adding unique marketing messages between certain products whilst using isotope/Infinite Scroll
- Amending PHP for WordPress Theme
- get_permalink returning first letter