Wordpress - How to echo the_excerpt without the P tag wrapper?
in your code above use get_the_excerpt()
instead of the_excerpt()
, because the last one will output the excerpt to the screen, and not pass it to your other functions...
What about removing the wpautop
filter before your list?
remove_filter( 'the_excerpt', 'wpautop' );
(Make sure to add it back afterwards, so as not to mess up other formatting...)