Preserve HTML tags in the excerpt
-
I would like to preserve the html tags of my post.
I’m not sure if i should change something in my own wordpress files or in your php file on line 380
(i’m no php expert 🙂 )
function rpwe_excerpt( $length ) {
$excerpt = explode( ‘ ‘, get_the_excerpt(), $length );
if ( count( $excerpt ) >= $length ) {
array_pop( $excerpt );
$excerpt = implode( ” “, $excerpt );
} else {
$excerpt = implode( ” “, $excerpt );
}
$excerpt = preg_replace( ‘\[[^\]]*\]
‘, ”, $excerpt );return $excerpt;
}
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Preserve HTML tags in the excerpt’ is closed to new replies.