So you just go into your header.php file and change:
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
to:
<link rel="stylesheet" href="http://reducisaurus.appspot.com/css?url=<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
no need for hooks.
I’m not exactly sure what I’m doing here and could use some help. From my research on the issue, I would think it would look something like this:
add_filter('wp_print_styles','reducisaurus_css',10,2);
function reducisaurus_css($css_url)
{
return "http://reducisaurus.appspot.com/css?url=" . $css_url;
}
The CSS files and such are only handled that way in the admin side of things, and they’re already optimized. Reducisaurus wouldn’t do anything. WordPress already combines and compresses and such for its admin pages.
For the website viewer facing side of things, the theme controls that stuff entirely. You’ll have to edit the theme’s header.php file.
Also, the notion of Reducisaurus is itself flawed. By making a compression service into a web service, you’re adding an extra step, not removing one. Reducisaurus will actually be slower in most cases than simply serving the files directly.
Upon further research of actions and filters, I came up with this: it works, although the result wasn’t worth the trouble.
add_filter(‘style_loader_src’,’reducisaurus_css’,10,2);
function reducisaurus_css($css_url, $handle)
{
return “http://reducisaurus.appspot.com/css?url=” . $css_url;
}
Otto42, thanks for your advice. I realized from the beginning that this wasn’t a practical thing to do. I simply wanted to learn more about hooks 🙂