remove_filter('the_content','wpautop');
//decide when you want to apply the auto paragraph
add_filter('the_content','my_custom_formatting');
function my_custom_formatting($content){
if(get_post_type()=='my_custom_post') //if it does not work, you may want to pass the current post object to get_post_type
return $content;//no autop
else
return wpautop($content);
}
1 回答
您可以通过将此内容放入主题的functions.php中来删除内容上的wpautop过滤器,方法如下: