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.

9 s
9

Style.css is required for your WordPress theme. That’s where WordPress gets the theme name and meta information for the Appearance >> Themes menu from. That said, you don’t actually have to use style.css in your theme at all. I know of several readily available themes that don’t use it, and I only use it in a handful of my custom designs.

In header.php just place the following tag in place of the regular stylesheet link:

<link rel="stylesheet" type="text/css" href="https://wordpress.stackexchange.com/questions/136/<?php bloginfo("stylesheet_directory'); ?>/style-1.css" />

This will load your alternative stylesheet as the page’s stylesheet and completely ignore the regular style.css.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *