Remove paragraph tags from your WordPress posts so your media stays put

There’s nothing more frustrating than embedding flash players into a post and then WordPress adds html that screws up the embed code.  One workaround I found was to remove the filter that adds paragraph tags automatically in posts by adding the following line just before the_content() tag in the single.php template file:

<?php remove_filter ('the_content',  'wpautop'); ?>

You could also apply this removal sitewide by modifying your wp-includes/default-filters.php file and commenting out the wpautop function.  Flash is now happy.

Additional resources:

http://codex.wordpress.org/Plugin_API#Removing_Actions_and_Filters
http://wordpress.org/support/topic/206698?replies=9

This entry was written by ross, posted on March 1, 2009 at 3:58 pm, filed under Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Timeline

20 Comments

Have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

:

: