Skip to content

Instantly share code, notes, and snippets.

@ashfame
Created December 31, 2011 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashfame/1543569 to your computer and use it in GitHub Desktop.
Save ashfame/1543569 to your computer and use it in GitHub Desktop.
Function to remove wpautop filter for specific post IDs
/**
* Function to remove wpautop filter for specific post IDs
*/
add_action( 'init', 'do_ma_thang' );
function do_ma_thang() {
global $wp_query;
$exclusion = array( 1, 5, 7 ); // add post IDs here
if ( in_array( $wp_query->post->ID, $exclusion ) )
remove_filter( 'the_content', 'wpautop' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment