Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The following filter will remove inline CSS generated by the Astra theme and Astra Pro plugin.
- // Paste the following code into child theme’s functions.php file
- function astra_force_remove_style() {
- add_filter( 'print_styles_array', function($styles) {
- // Set styles to remove.
- $styles_to_remove = array('astra-theme-css', 'astra-addon-css');
- if(is_array($styles) AND count($styles) > 0){
- foreach($styles AS $key => $code){
- if(in_array($code, $styles_to_remove)){
- unset($styles[$key]);
- }
- }
- }
- return $styles;
- });
- }
- add_action('wp_enqueue_scripts', 'astra_force_remove_style', 99);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement