Support » Plugin: Cookie Notice for GDPR & CCPA » Removing cookie-notice-front-css

  • Hi,

    I am want to stop front.css file from loading when a page is loaded. I embedded all the styles in my main style.css file.

    I tried to do it by adding the following code inside my functions.php, but it didn’t work.

    function dequeue_unused_css_files() {
      wp_dequeue_style('cookie-notice-front-css');
      wp_deregister_style('cookie-notice-front-css');
    }
    add_action('wp_enqueue_scripts','dequeue_unused_css_files',100);

    I will appreciate a suggestion on how could I remove this file.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author dFactory

    (@dfactory)

    Hey Marcin,

    You’re doing ok just the name of the style should be different – try “cookie-notice-front” instead of “cookie-notice-front-css”
    The “-css” part is being added by WordPress to all enqueued styles.

    Pozdrowienia 🙂
    Bartosz / dfactory team

    • This reply was modified 3 years, 2 months ago by dFactory.

    Hey Bartosz,

    Interesting, I wasn’t aware of that.

    Thanks for the suggestion, it worked this time 🙂

    Awesome plugin! Keep up the great work!

    Pozdrawiam serdecznie,
    Marcin

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing cookie-notice-front-css’ is closed to new replies.