Shin

Disable automatic WordPress paragraphs

WordPress automatically wraps content in html paragraphs. Sometimes this can be undesired, for example when you’re making one-liner posts using the new post formats for links or status updates. The easiest way around this is by setting the filter in your template.
It looks like this, snippet taken from my format-status.php:

remove_filter('the_content','wpautop');
the_content('Read more...');
add_filter('the_content','wpautop');

First we use remove_filter to tell WordPress not to use automatic < p> tags for the_content, then we output the content, and immediately afterwards we use add_filter to restore the filter or it’ll also be off for all the subsequent posts on the page.

Comments

Comments are closed.

Work in progress... not home!
Trying to get all/most of the new code working before I start on the eyecandy.