I removed wpautop
from my theme:
function disable_linebreaks($content) {
remove_filter ('the_content','wpautop');
return $content;
}
add_filter('the_content','disable_linebreaks',1);
But now, when switching between HTML and Editor ALL p-tags disappear, even the ones I coded myself.
What I want is just to prevent Wordpress from adding empty <p></p>
- Code. Basically I'm happy with wpautop
, it's just that sometimes it's too much (For example around images. There's always an empty p before every image).
wpautop
? – s_ha_dum Jul 29 '13 at 14:19