[wp-hackers] Dynamic Style Sheets

chris burgess chris at giantrobot.co.nz
Sun Apr 29 06:19:55 GMT 2007

Not exactly what you're asking, but ...

I used a php-generated JS file to do this for another site. I had to add
the Status header manually for at least one version of WP2.

There may be a "more correct" way to do this, one which doesn't involve
overwriting the 404 header that appear(s|ed) if WP doesn't recognise
your direct reference of teh CSS/JS file.

  define('WP_USE_THEMES', false) ;
  header("HTTP/1.1 200 OK");
  header("Status: 200 All rosy") ;

 * javascript or css here

this way you can reference the CSS/JS and it will work.

I'd love to hear a more "proper" way to embed WP functions without
activating the request handler. I couldn't find it at the time.

if WP sets a 404 header on a JS or CSS file, then only some browsers
will parse it (guess who), while others will ignore it unless it has a
200 or other goody.

More information about the wp-hackers mailing list