Unclosed html tags (get_the_content)
-
Hello,
Bit of a problem. I’m using get_the_content and mb_trimwidth to control the number of characters in posts. Since the posts (created by plugin that generates posts from RSS feeds) contain html sometimes the truncation will leave an open html tag – for example if there is opening strong tag and it truncates before that tag is closed then all subsequent text will be bold.
Is there a way to auto close all open tags?
Here is the code I’m using to display the posts on my webpage:
<?php $content = get_the_content(); echo mb_strimwidth($content, 0, 850, '...');?>
This is part of the loop as the posts are being displayed outside the theme.
Thank you for any suggestions!
Daf
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Unclosed html tags (get_the_content)’ is closed to new replies.