I want to use next PHP script to serve combined, pre-gzipped and minified JS and CSS files. source code is available here: https://code.google.com/p/compress/
There is a WAMP localhost with wordpress installed.
And what I have done:
added three files (jsmin.php, cssmin.php, compress.php) in child-theme's folder;
added directory 'min' in child-theme folder;
created file 'compress_timestamp.php'
added code below into header.php (tried functions.php then tried first line of header.php)
require_once('compress_timestamp.php'); //load timestamp created by compress.php module sets field $compress_stamp=unix_timestamp
if (stripos($_SERVER['HTTP_ACCEPT_ENCODING'],'GZIP')!==false)
$gz='gz'; else $gz=null; echo '<link rel="stylesheet" type="text/css" href="min/css_schedule_'.$compress_stamp.'.css'.$gz.'" />',PHP_EOL; // the following scripts were combined into css_schedule // echo '<link rel="stylesheet" type="text/css" href="CSS/menu.css" />',PHP_EOL; // echo '<link rel="stylesheet" type="text/css" href="CSS/ThreeColumnFixed.css" />',PHP_EOL; // echo '<link rel="stylesheet" type="text/css" href="CSS/sprite.css" />',PHP_EOL; // echo '<link rel="stylesheet" type="text/css" href="CSS/iCal.css" />',PHP_EOL;
changed lines accordingly to child-theme and parent folders:
echo '<link rel="stylesheet" type="text/css" href="style.css" />',PHP_EOL; echo '<link rel="stylesheet" type="text/css" href="../twentyfourteen/style.css"
What was missed and what is the right way to make it work?
And finally when all is done how to launch that script remotely on XAMP (VPS)?