Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

coriander on "Manual excerpt - how to keep html tag"

$
0
0

I have manual excerpts and the <p> and
tags are always stripped...
I'm trying to find out how to keep them!

I've come up with the following function in functions.php, please any suggestions are appreciated.

function custom_wp_excerpt_tags($text) {
  $text = get_the_excerpt();

  $text = strip_tags($text, '<br>');

    return ( $text );
}
remove_filter('get_the_excerpt','strip_tags');
add_filter('get_the_excerpt', 'custom_wp_excerpt_tags');

Viewing all articles
Browse latest Browse all 8245

Trending Articles