Last active
January 16, 2019 22:08
-
-
Save wplit/1077a90bd9492b245f12c42f00e2ab0b to your computer and use it in GitHub Desktop.
Conditionally remove WP block editor (gutenberg) library CSS from front
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
add_action( 'wp_print_styles', 'lit_deregister_editor_styles', 100 ); | |
/** | |
* Removes WP block editor styles | |
*/ | |
function lit_deregister_editor_styles() { | |
if ( !is_singular('post') ) { // If isn't a single post, remove excess block libary CSS | |
wp_dequeue_style( 'wp-block-library' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment