Preserve HTML in excerpt field

Is there a way to preserve HTML markup in an excerpt field when I use it in Loops and Logic templates?

Sometimes I add HTML to italicize words inside post excerpts, and when I use the default blog page, it preserves this HTML markup. However, when I display the excerpt with a Loops and Logic Field, the markup disappears.

So say I enter this in the WordPress excerpt field:

Read this article about <em>Pride and Prejudice</em>.

And the Loops and Logic template is this:

<p><Field excerpt /></p>

This is what I’ll see on the front end—no italics:

Read this article about Pride and Prejudice.

And if I right click in the browser and inspect element, then I see this—no HTML inside the excerpt:

<p>Read this article about Pride and Prejudice.</p>

I’ve tried looking through the documentation and don’t see any instructions for preserving the HTML in this type of field. Is this supported? If not, I can put it in the suggested features topic.

Interesting, I had never played around with adding HTML to excerpts but you’re right that default WordPress keeps the HTML tags while L&L seems to strip them. This doesn’t seem like something that plugin users would need to have control over, you’d kind of just expect L&L to work the same way as default WP and keep the tags intact. I’d suggest making a feature request for that since that seems pretty straightforward to implement, but a dev would need to look into that to be sure.

Thanks. I’ve tried to submit a feature request, but it will not let me log in. (I’ve tried several times to submit the comment and it just keeps telling me to log in; so I enter my login details and it brings me back to the forum, but I haven’t been logged in…) Would you mind putting this in as a feature request?

1 Like

Added the feature request. I’ll look into the log-in issue you’re describing too.

1 Like