require_once called by wp_head?
-
hey there,
I’m working on my first plugin and ran into a problem. I need to include the following on every page:
require_once('class.compressor.php');
$compressor = new compressor('css,javascript,page');
I figured the following should do the trick:
function wp_compressor_header() {
require_once(dirname(__FILE__) . '/class.compressor.php');
$compressor = new compressor('css,javascript,page');
}add_action('wp_head', 'wp_compressor_header');
However, I’m stuck with “syntax error, unexpected T_VARIABLE” and similar errors.
My question: how to include the require_once in wp_head properly and how to call the class properly?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘require_once called by wp_head?’ is closed to new replies.