Minify Style Sheet

To minify your front end style sheet:

  1. Open the style sheet file:

    Version 2.8x: This is the style.php file in the main public site folder.

    Versions earlier than 2.8: This is the stylecss.php file in the /enc/ folder.

  2. Almost at the bottom of the page, find the line:

    if ($showstyle == "yes")
  3. Just above that line, add:

    // MINIFY STYLE
    $styleinfo = str_replace(array(" ", " ", " ", " "), ' ', $styleinfo);
    $styleinfo = preg_replace("/( ){2,}/", " ", $styleinfo);
    $styleinfo = preg_replace('!/*[^*]**+([^/][^*]**+)*/!', '', $styleinfo);
    $styleinfo = preg_replace('/ss+/', ' ', $styleinfo);
    $styleinfo = trim($styleinfo);
  4. Save and reload the page.