自動的に<p>タグが挿入されるのを避ける
「<!–handmade–>」というコメントを入れておくと自動的に<p>タグが挿入されなくなるようにした
function rm_wpautop($content) {
global $post;
// Get the keys and values of the custom fields:
if(preg_match('||siu',$content)){
remove_filter('the_content', 'wpautop');
} else {
add_filter('the_content', 'wpautop');
}
return $content;
}
// Hook into the Plugin API
add_filter('the_content', 'rm_wpautop', 9);