Home Forums Webzine WordPress Theme Post HTML stripped out on list page templates Reply To: Post HTML stripped out on list page templates

#2135

BWSM
Keymaster

Try to remove the code in functions.php plz:

function better_excerpt($text, $excerpt_length) {
		$text = str_replace(']]>', ']]>', $text);
		$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);
		// replace </p> with <br> and remove <p>
		$text = str_replace("<p>", "", $text);
		$text = str_replace("</p>", "<br/>", $text);
		$text = strip_tags($text, "<br/>");
		$text = str_replace("<br>", "", $text);
		$words = explode(' ', $text, $excerpt_length + 1);
		if (count($words)> $excerpt_length) {
			array_pop($words);
			array_push($words, '...');
			$text = implode(' ', $words);
		}
		$text = ltrim($text, "<br>");
		$text = trim($text);
		if ($text == "/>") $text = "";
		if (substr($text, 0, 2) == "/>") $text = substr($text, 2);
	//return "<p>$text</p>";
	return "$text";
}

Join Newsletter(FREE)

Subscribe to our newsletter to receive news & updates. We promise to not spam you, super promise!