Dequeue a style file which is making website load slow!

Question

I have a website running on GrandNews WordPress Theme (https://themeforest.net/item/grand-news-news-magazine/15885465) and loading via KeyCDN. The site is loading a CSS file located at websitedomain.kxcdn.com/wp-content/themes/grandnews/modules/kirki/assets/css/kirki-styles.css which is of 0KB size and not in use. This file “kirki-styles.css” is making website load slow as you can see here: http://prntscr.com/qoho6e and CDN support suggested me to dequeue the stylesheet in a child theme functions.php file which I tried to but somehow it’s not working and server still try to load file and gives 504 error.

Maybe something wrong with my code. So far I have followed these steps:

  1. Created a Child Theme and tested it… It’s working.
  2. Tried following pieces of code to try to make it to work
    (Nothing extra)

     add_action('wp_enqueue_scripts', 'kirki_style_remove', 100);
        function kirki_style_remove()
        {
            wp_dequeue_style('/wp-content/themes/grandnews/modules/kirki/assets/css/kirki-styles.css');
        }
    

    Tried this way once as well:

    function wp_dequeue_kirki_style()
    {
        wp_dequeue_style('kirki-styles', 'websitedomain.kxcdn.com/wp-content/themes/grandnews/modules/kirki/assets/css/kirki-styles.css');
        // wp_deregister_style('kirki-styles');
    }
    add_action('wp_enqueue_scripts', 'wp_dequeue_kirki_style', '999');
    

Apart from these two codes above, I also tried a plugin but that didn’t work as well.

Please advise with the most efficient solution. Thanks in advance!

0
, , , Sheryl 2 years 2020-01-16T08:38:23-05:00 0 Answers 101 views 0

Leave an answer

Browse
Browse