Content limit on the_content that doesn't strip HTML
-
I’ve seen various ways to do this before, but none seem to accomplish my goal.
I’ve been using wp_trim_words to limit the content, but it strips out html, which I want to keep. For example, if I have bolded text in the first sentence of my content, I want it to remain bolded. Here’s how I’m using the function,
echo wp_trim_words( get_the_content(), 15 );
Is there something I can add to retain html tags?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Content limit on the_content that doesn't strip HTML’ is closed to new replies.