Created
June 5, 2014 00:06
-
-
Save andrewlaskey/c6b4ea902d52aeb6f098 to your computer and use it in GitHub Desktop.
Remove Wordpress auto paragraph tags only on pages not posts
This file contains 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
<?php | |
add_filter('the_content', 'specific_no_wpautop', 9); | |
function specific_no_wpautop($content) { | |
global $post; | |
if (is_page()) { // or whatever other condition you like | |
remove_filter( 'the_content', 'wpautop' ); | |
return $content; | |
} else { | |
return $content; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment