Dynamically link /sites/default/css/css_***.css file for WordPress template header FYI, I don't know Drupal at all. What I've done is stick a WordPress install at /blog/ and pull in the /sites/default/css/css_randomstring.css and static html from the Drupal page - and along with the WordPress loop in the index.php file of Wordpress - somewhat integrate WordPress into Drupal. (I don't want to use the Drupal WP module).

The problem is that the Drupal CSS link changes when there are small edits from time to time on the Drupal end. (The php/html of the Drupal site isn't slated to change.)

Question: are these randomstring CSS files a cache or the active CSS file? How can I dynamically pull in the sites/default/css/css_(randomstring).css file when the string changes? Or is there a different CSS file I should be linking to?
To answer your direct question, drupal's CSS and JS aggregation contains a random MD5 hash to guarantee uniqueness, and also to guarantee that there is no programmatic way to work this out.

In order to include CSS and JS from an aggregated site into another CMS there are a couple of options:


Use un-aggregated CSS and JS and link to the files direct (bad)
Compress the files yourself and host them in a known location - e.g. /css/main-compressed.css
Or another option is what we have used in the past where you basically make a really simple page.tpl.php which includes basically no content, and is for all intensive purposes a blank wrapper for your site. You have your other CMS drag this template down after every deployment, and then used it for it's page wrapper. This way you do not need to worry about the CSS and JS changing as you always have the most up to date versions in the &lt;head&gt; section.


Hope this helps