Support » Plugin: Autoptimize » Two css files in head

  • Resolved maksymdavydchuk

    (@maksymdavydchuk)


    Hello. On my website, the plugin generates two css files, is this normal? Or it is possible to make one general file?

    Screenshot

    And is it possible to load these resources asynchronously? So that they do not block the download?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    yes, that’s normal @maksymdavydchuk, one is media="all" and the other for media="screen". you could try forcing all CSS to media="all" using this (untested!) code snippet (but it could also break your styling);

    
    add_filter('autoptimize_filter_css_tagmedia','check_mediatype',10,2);
    function check_mediatype($media,$tag) {
      $media=array("all");
      return $media;
    }

    regarding asynchronously loading the CSS, have a look at the “inline & defer CSS” option, cfr. info in FAQ

    hope this helps,
    frank

Viewing 1 replies (of 1 total)
  • The topic ‘Two css files in head’ is closed to new replies.