Created
December 22, 2017 16:20
-
-
Save remyperona/b2218898267332ffc358c08106558052 to your computer and use it in GitHub Desktop.
Exclude specific post type/taxonomy from automatic critical CSS generation
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
<?php | |
function wp_rocket_cpcss_exclude_post_type( $excluded_post_types ) { | |
$excluded_post_types[] = 'page'; | |
return $excluded_post_types; | |
} | |
add_filter( 'rocket_cpcss_excluded_post_types', 'wp_rocket_cpcss_exclude_post_type' ); | |
function wp_rocket_cpcss_exclude_taxonomy( $excluded_taxonomies ) { | |
$excluded_taxonomies[] = 'category'; | |
return $excluded_taxonomies; | |
} | |
add_filter( 'rocket_cpcss_excluded_taxonomies', 'wp_rocket_cpcss_exclude_taxonomy' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment