Skip to content

Instantly share code, notes, and snippets.

@swinggraphics
Created June 7, 2018 01:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swinggraphics/4ca551447bec03da281424c4ff85dcfd to your computer and use it in GitHub Desktop.
Save swinggraphics/4ca551447bec03da281424c4ff85dcfd to your computer and use it in GitHub Desktop.
WordPress strips out tags in `wp_trim_words()`, which is called by `get_the_excerpt()`; so we have to filter 'wp_trim_words', basically copying that function with one change: replace `wp_strip_all_tags()` with `strip_tags()`. We don't want other functions that run `wp_trim_words` to be modified, so we add our filter while `get_the_excerpt()` is …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment