Don't strip certain tags in excerpt
-
I have a magazine style layout all set up to automatically post a thumbnail, and a 100 word excerpt on the front page for each new article.
However, one thing that I can’t figure out is the html tags. It’s stripping out html tags in the excerpt by default. This is generally a good one, but I want to leave some tags in there (like <p> for instance) without stripping them out.
I tried this guide: https://www.aaronrussell.co.uk/blog/improving-wordpress-the_excerpt/
It basically says to copy wp_trim_excerpt into the themes funcions.php file, rename it, and change the html stripping line to ignore <p> tags. However, when I do this the entire excerpt disappears.
Any ideas on a way to accomplish what I’m looking for?
- The topic ‘Don't strip certain tags in excerpt’ is closed to new replies.