Manual excerpt – how to keep html tag
-
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');
- The topic ‘Manual excerpt – how to keep html tag’ is closed to new replies.