Created
March 2, 2020 15:41
-
-
Save dibakarjana/c3413e47254bf9c5af4a89649e1fc123 to your computer and use it in GitHub Desktop.
remove_filter( 'the_content', 'wpautop' ); only for certain post types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment