How can I disable automatic paragraph tags, but retain line breaks?
I have used this to remove wpautop:
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
But there are no more line breaks in the text.
How can I disable automatic paragraph tags, but retain line breaks?
I have used this to remove wpautop:
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
But there are no more line breaks in the text.
Comments are closed.
Here’s the full solution.
First disable wpautop in your functions.php
Then parse your content/excerpt with nl2br (a standard PHP function).