How can I instruct wordpress to use a filename other than 'styles.css' for my main stylesheet - for example, styles-1.css? I'd like to do this for versioning and caching purposes.
|
In
This will load your alternative stylesheet as the page's stylesheet and completely ignore the regular |
|||
|
|
I'm not sure if this has changed for WP3, so I'm not wholly sure, but one way is to edit the relevant php file directly (I don't know if it can be done from within the Dashboard/Admin pages):
And open up
To add a 'version' to the linked stylesheet (assuming you want it to be something like:
This is kind of inelegant, though, so if there's a better way I'd love to hear it myself =) I just re-read your question... To use a different stylesheet
(Basically removing the |
|||||||||
|
|
Drop this in your theme's functions.php file:
|
|||||||||
|
|
This may be inappropriate, please let me know if I missed something. The fourth argument to
Requires that your This allows you to push long expiry headers with your CSS file, and force clients to download a new file by updating the version number. WP will append "?ver=N" to the URL of your CSS file. |
||||
|
|
|
Well, you could simply use
Then when you upgrade a version, just edit it to be:
As for saving versions, have you considered using a Subversion, or git? Then you can have a complete track record of your stylesheet. It's possible I'm not fully understanding the full reasons for your versioning. |
||||
|
|
|
EAMann is correct, you don't have to use the For versioning the style sheet and other files in your theme you can add this to your functions.php file
And then when you make the link to your style sheet you can do this.
This way you don't have to manually update the version number, anytime the file is updated on the server the version will automatically change to that UNIX timestamp |
||||
|
|
|
I know that this thread is rather old by now. But in case someone needs a quick solution. There is a plugin called Versions which handles versioning of stylesheets and scripts automatically. Get it at: http://wordpress.org/extend/plugins/versions/ |
|||
|
