There are times when we want to get rid of wp_autop filter. This little fellow removes paragraph and linebreaks
tags and autogenerates them where he thinks they should occur. From time to time this is quite troublesome and we simply want to get rid of that.
But do we really know what would be the consequences of that?
[php]
remove_filter( ‘the_content’, ‘wpautop’ );
function new_wp_content($content) {
return $content;
}
add_filter( ‘the_content’, ‘new_wp_content’ );
[/php]
This will not only affect content display for each page and post, but also our RSS feeds, making them mostly unreadable.
This is where WP conditional tags come in handy, with a simple trick it will keep our feeds untouched.
Yeah, you can whatever you want with that code above, stop nerding 😛
[php]
remove_filter( ‘the_content’, ‘wpautop’ );
function new_wp_content($content) {
if (is_feed())
return wp_autop($content);
else
return $content;
}
add_filter( ‘the_content’, ‘new_wp_content’ );
[/php]