Code Snippet
Disable Automatic Formatting
Add to functions.php file
remove_filter('the_content', 'wptexturize');
remove_filter('the_excerpt', 'wptexturize');
remove_filter('comment_text', 'wptexturize');
remove_filter('the_title', 'wptexturize');
the wptexturize function is responsible for lots of automatic alterations to text stored in WordPress like automatic elipses (...), em and en dashes, typographers quotes, etc.
Is there a solution for just removing paragraph tags wrapped around images?
Regardless, if you’re a developer or writer, those automatically generated paragraphs wrapped around images tend to break a layout and add unnecessary markup.
Personally, I’ve had to wrap images inside divs, but that still defeats the purpose of excess markup. Plus, the average writer using the visual editing mode is not going to understand how to wrap images inside divs without specific instructions.
Yes, you can using CSS3 for removing empty paragraph.
http://digwp.com/2009/10/clean-up-empty-elements-css3/
OR Jquery
http://css-tricks.com/snippets/jquery/check-for-empty-elements/
I know this is a little late, but to remove the auto paragraphs, replace wptexturize with wpautop in the above code snippet
Hi guys,
I know THIS post is a bit late, but I just wanted to say this technique doesn’t seem to work for me in WordPress 3.
Do you have any suggestions? Ideas?
Thanks.
How can I do the same thing for a custom field?
I have:
get_post_meta($post->ID, ‘gallery’, $single = true));
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.