Created
September 18, 2017 20:28
-
-
Save 2aces/9cba9e2d47444301d9fa2eb032a8cb29 to your computer and use it in GitHub Desktop.
WordPress: remove custom CSS created by Customizer
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
// first check if we are not in Admin area | |
if( !is_admin ){ | |
// check if we are in an archive | |
if( is_archive() ){ | |
//remove wp_custom_css_cb from the actions queue on wp_head using the same priority, 101 | |
remove_action('wp_head', 'wp_custom_css_cb', 101); | |
} | |
} |
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
// first check if we are not in Admin area | |
if( !is_admin ){ | |
// get post global variable | |
global $post; | |
// check if post_id is equals to the post/page/custom_post ID we want to filter the CSS | |
if( $post->post_id === 10){ | |
//remove wp_custom_css_cb from the actions queue on wp_head using the same priority, 101 | |
remove_action('wp_head', 'wp_custom_css_cb', 101); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment